/* Bytechap site styles. Light and dark themes follow the visitor's system setting.
   Bump ASSET_VERSION in src/layout.js after editing this file. */

:root {
  /* Brand: primary green oklch(62.7% 0.194 149.214) = #00a63e, secondary orange oklch(64.6% 0.222 41.116) = #f54900.
     Both are too light for small text on white (3.2:1 and 3.6:1), so text uses the -text shades (4.9:1 and 5.2:1)
     and filled buttons carry dark text (6.2:1 and 5.5:1). */
  --primary: oklch(62.7% 0.194 149.214);
  --primary-hover: oklch(72.3% 0.219 149.579);
  --primary-text: oklch(52.7% 0.154 150.069);
  --primary-soft: oklch(96.2% 0.044 156.743);
  --secondary: oklch(64.6% 0.222 41.116);
  --secondary-hover: oklch(70.5% 0.213 47.604);
  --secondary-text: oklch(55.3% 0.195 38.402);
  --secondary-soft: oklch(95.4% 0.038 75.164);
  --on-primary: #03140a;
  --on-secondary: #1f0a00;
  --focus: oklch(52.7% 0.154 150.069);

  --bg: #fafaf9;
  --bg-soft: #f5f5f4;
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --ink: #1c1917;
  --text: #292524;
  --muted: #57534e;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;
  --band: #1c1917;
  --band-text: #e7e5e4;
  --on-ink: #ffffff;
  --header-bg: rgb(250 250 249 / 88%);
  --shadow: 0 1px 2px rgb(28 25 23 / 5%), 0 8px 24px rgb(28 25 23 / 6%);
  --shadow-lg: 0 2px 4px rgb(28 25 23 / 5%), 0 24px 56px rgb(28 25 23 / 12%);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Hiragino Mincho ProN', 'Noto Serif JP', serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --accent: var(--primary-text);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-text: oklch(72.3% 0.219 149.579);
    --primary-soft: rgb(0 166 62 / 16%);
    --secondary-text: oklch(75% 0.183 55.934);
    --secondary-soft: rgb(245 73 0 / 17%);
    --focus: oklch(72.3% 0.219 149.579);
    --bg: #0c0a09;
    --bg-soft: #151210;
    --surface: #1c1917;
    --surface-2: #211d1b;
    --ink: #fafaf9;
    --text: #e7e5e4;
    --muted: #a8a29e;
    --line: #292524;
    --line-strong: #44403c;
    --band: #1c1917;
    --band-text: #d6d3d1;
    --on-ink: #0c0a09;
    --header-bg: rgb(12 10 9 / 86%);
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 35%);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 40%), 0 24px 56px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

/* Japanese: no serif web font covers kana and kanji, so headings and articles use the sans stack. */
html:lang(ja) { --serif: var(--font); }

/* Product accents (products.accent in D1) */
[data-accent="blue"] { --accent: #2f5bd3; }
[data-accent="violet"] { --accent: #7c3aed; }
[data-accent="cyan"] { --accent: #0782b0; }
[data-accent="green"] { --accent: #008236; }
[data-accent="amber"] { --accent: #b45309; }
[data-accent="forest"] { --accent: #3f7d20; }
[data-accent="indigo"] { --accent: #4f46e5; }
[data-accent="teal"] { --accent: #0f766e; }
[data-accent="emerald"] { --accent: #047857; }
[data-accent="orange"] { --accent: #ca3500; }
@media (prefers-color-scheme: dark) {
  [data-accent="blue"] { --accent: #8ea8ff; }
  [data-accent="violet"] { --accent: #b99bff; }
  [data-accent="cyan"] { --accent: #6fcff0; }
  [data-accent="green"] { --accent: #05df72; }
  [data-accent="amber"] { --accent: #f2b75a; }
  [data-accent="forest"] { --accent: #a3d97f; }
  [data-accent="indigo"] { --accent: #a5a1ff; }
  [data-accent="teal"] { --accent: #6fd6cb; }
  [data-accent="emerald"] { --accent: #6ee0b5; }
  [data-accent="orange"] { --accent: #ff8904; }
}
[data-accent] { --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Topic colors: tags, chips and image placeholders */
[data-topic] { --topic: var(--primary-text); }
[data-topic="ai"] { --topic: #008236; }
[data-topic="agents"] { --topic: #ca3500; }
[data-topic="ai-engineering"] { --topic: #0f766e; }
[data-topic="open-models"] { --topic: #7c3aed; }
[data-topic="developer-tools"] { --topic: #2f5bd3; }
[data-topic="cloud-infrastructure"] { --topic: #0369a1; }
[data-topic="security"] { --topic: #c10007; }
[data-topic="data-documents"] { --topic: #a65f00; }
[data-topic="mobile-devices"] { --topic: #c6005c; }
[data-topic="self-hosting"] { --topic: #4d7c0f; }
@media (prefers-color-scheme: dark) {
  [data-topic="ai"] { --topic: #05df72; }
  [data-topic="agents"] { --topic: #ff8904; }
  [data-topic="ai-engineering"] { --topic: #46ecd5; }
  [data-topic="open-models"] { --topic: #c4b4ff; }
  [data-topic="developer-tools"] { --topic: #8ec5ff; }
  [data-topic="cloud-infrastructure"] { --topic: #74d4ff; }
  [data-topic="security"] { --topic: #ffa2a2; }
  [data-topic="data-documents"] { --topic: #ffd230; }
  [data-topic="mobile-devices"] { --topic: #fda5d5; }
  [data-topic="self-hosting"] { --topic: #bbf451; }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16.5px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--secondary-text); }
h1, h2, h3, h4 { color: var(--ink); font-family: var(--serif); font-weight: 650; letter-spacing: -0.015em; line-height: 1.15; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.07; letter-spacing: -0.025em; }
h2 { font-size: clamp(25px, 2.6vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { padding-left: 1.3em; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--primary-soft); color: var(--ink); }
.icon { flex: none; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip-link:focus { top: 12px; color: var(--on-ink); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--secondary-text); }
html:lang(vi) .eyebrow, html:lang(ja) .eyebrow { font-family: var(--font); font-weight: 600; letter-spacing: 0.06em; }
[data-accent] .eyebrow { color: var(--accent); }
.lead { font-size: clamp(18px, 1.5vw, 20px); line-height: 1.6; color: var(--muted); max-width: 64ch; }
.stretched::after { content: ''; position: absolute; inset: 0; z-index: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background-color .15s, color .15s, transform .15s;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: var(--secondary); border-color: var(--secondary); color: var(--on-secondary); }
.btn-secondary:hover { background: var(--secondary-hover); border-color: var(--secondary-hover); color: var(--on-secondary); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary-text); }
.btn-ghost:hover { background: var(--primary-soft); border-color: transparent; color: var(--primary-text); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-arrow .icon { transition: transform .15s; }
.link-arrow:hover .icon { transform: translateX(2px); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: var(--ink); }
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: saturate(1.5) blur(12px); -webkit-backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 26px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { flex: none; border-radius: 9px; }
.brand-name { font: 800 21px/1 var(--font); letter-spacing: -0.04em; }
.brand-name span { color: var(--primary-text); }
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav > a, .topic-menu > summary {
  display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 999px;
  color: var(--text); font-weight: 550; font-size: 15px; text-decoration: none; cursor: pointer; list-style: none;
}
.topic-menu > summary::-webkit-details-marker { display: none; }
.main-nav > a:hover, .topic-menu > summary:hover { background: var(--bg-soft); color: var(--ink); }
.main-nav > a[aria-current="page"], .topic-menu > summary[aria-current="page"] { color: var(--ink); background: var(--primary-soft); }
.topic-menu { position: relative; }
.topic-menu[open] > summary .icon { transform: rotate(180deg); }
.topic-panel {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 60; width: min(560px, 90vw);
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.topic-panel a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 550; font-size: 15px; }
.topic-panel a .icon { color: var(--topic); }
.topic-panel a:hover, .topic-panel a[aria-current="page"] { background: var(--bg-soft); color: var(--ink); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lang-switch { position: relative; }
.lang-switch > summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; padding: 8px 10px; border-radius: 999px; cursor: pointer; color: var(--text); font: 600 13px var(--font); }
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary:hover { background: var(--bg-soft); color: var(--ink); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 180px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); display: grid; }
.lang-menu a { padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 15px; }
.lang-menu a:hover { background: var(--bg-soft); color: var(--ink); }
.lang-menu a[aria-current="true"] { font-weight: 700; color: var(--primary-text); }
.mobile-nav { display: none; margin-left: auto; }
.mobile-nav > summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; color: var(--ink); }
.mobile-nav > summary::-webkit-details-marker { display: none; }
.mobile-nav .when-open { display: none; }
.mobile-nav[open] .when-open { display: inline; }
.mobile-nav[open] .when-closed { display: none; }
.mobile-panel {
  position: absolute; left: 0; right: 0; top: 64px; z-index: 60; max-height: calc(100vh - 64px); overflow-y: auto;
  display: grid; gap: 4px; padding: 14px var(--gutter) 22px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.mobile-panel > a:not(.btn) { padding: 12px 6px; color: var(--ink); font-weight: 650; font-size: 17px; text-decoration: none; border-bottom: 1px solid var(--line); }
.mobile-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mobile-topics .eyebrow { grid-column: 1 / -1; margin-bottom: 4px; }
.mobile-topics a { display: flex; align-items: center; gap: 8px; padding: 8px 4px; color: var(--text); text-decoration: none; font-size: 15px; }
.mobile-topics a .icon { color: var(--topic); }
.mobile-langs { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 14px 4px; font-size: 15px; }
.mobile-langs a { color: var(--text); text-decoration: none; }
.mobile-langs a[aria-current="true"] { font-weight: 700; color: var(--primary-text); }

@media (max-width: 960px) {
  .main-nav, .header-actions { display: none; }
  .mobile-nav { display: block; }
}

/* Sections */
.section { padding: clamp(36px, 5vw, 56px) 0; }
.section-tight { padding-top: clamp(16px, 2.5vw, 28px); }
.section + .section { padding-top: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head h2 { margin-bottom: 4px; }
.section-head p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.section-title-sm { font-size: 24px; margin-bottom: 18px; }
@media (max-width: 640px) { .section-head { flex-direction: column; align-items: flex-start; } }

/* Masthead (home) */
.masthead { padding: clamp(28px, 4.5vw, 52px) 0 clamp(8px, 1.5vw, 16px); }
.masthead-inner { display: grid; gap: 22px; }
.masthead h1 { max-width: 18ch; margin: 10px 0 12px; }
.masthead h1 em { font-style: italic; color: var(--primary-text); }
.masthead .lead { margin: 0; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chips a {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 550;
}
.topic-chips a .icon { color: var(--topic); }
.topic-chips a:hover { border-color: var(--topic); color: var(--ink); }

@media (max-width: 640px) {
  /* One swipeable row of topics on phones, so the top story stays near the top of the screen. */
  .topic-chips, .filter-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; }
  .topic-chips::-webkit-scrollbar, .filter-chips::-webkit-scrollbar { display: none; }
  .topic-chips a, .filter-chips a { flex: none; }
  .masthead h1 { font-size: 34px; }
  .masthead .lead { font-size: 17px; }
}

/* Topic tag */
.topic-tag { display: inline-flex; align-items: center; font: 600 12.5px/1.3 var(--font); letter-spacing: 0.02em; text-transform: uppercase; color: var(--topic); text-decoration: none; }
html:lang(ja) .topic-tag, html:lang(vi) .topic-tag { text-transform: none; letter-spacing: 0; }
.topic-tag:hover { color: var(--ink); }
.kicker { font: 700 12.5px/1.3 var(--font); letter-spacing: 0.02em; text-transform: uppercase; color: var(--secondary-text); }
.post-row-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; min-height: 18px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--muted); }
.post-meta a { color: inherit; }

/* Image placeholders when a post has no illustration yet */
.thumb-fallback {
  display: grid; place-items: center; width: 100%; height: 100%; aspect-ratio: 16 / 9;
  color: var(--topic); background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--topic) 18%, transparent), transparent 55%),
    radial-gradient(circle at 85% 90%, color-mix(in srgb, var(--secondary) 14%, transparent), transparent 50%),
    var(--bg-soft);
}

/* Source figures used as a post image: show the whole diagram on white instead of cropping it */
.is-figure { background: #fff; }
.is-figure img { object-fit: contain !important; padding: 4%; background: #fff; }
.article-hero.is-figure img { border: 1px solid var(--line); }

/* Front page: lead story + latest rail */
.front-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 44px); align-items: start; }
.post-lead-media { display: block; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-soft); aspect-ratio: 16 / 9; }
.post-lead-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-lead:hover .post-lead-media img { transform: scale(1.02); }
.post-lead-body { padding-top: 18px; }
.post-lead-title { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; letter-spacing: -0.02em; margin: 4px 0 10px; }
.post-lead-title a, .post-card-title a, .post-row-title a, .post-mini-title a { color: var(--ink); text-decoration: none; }
.post-lead-title a:hover, .post-card-title a:hover, .post-row-title a:hover, .post-mini-title a:hover { color: var(--primary-text); }
.post-lead-dek { font-size: 18.5px; line-height: 1.55; color: var(--muted); max-width: 62ch; margin-bottom: 12px; }
.latest-rail { display: grid; gap: 0; border-top: 3px solid var(--ink); }
.rail-title { font: 700 13px/1 var(--font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); margin: 14px 0 4px; }
.post-mini { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.post-mini-title { font-size: 18.5px; line-height: 1.25; margin: 0 0 8px; }
.post-mini .post-meta { font-size: 13px; }
.post-mini-thumb { display: block; border-radius: 10px; overflow: hidden; background: var(--bg-soft); aspect-ratio: 16 / 9; align-self: start; }
.post-mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-mini-thumb .thumb-fallback .icon { width: 22px; height: 22px; }
.latest-rail .link-arrow { margin-top: 16px; }
@media (max-width: 900px) {
  .front-grid { grid-template-columns: 1fr; }
}

/* Post cards */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.5vw, 32px); }
.post-card { display: grid; align-content: start; }
.post-card-media { display: block; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); aspect-ratio: 16 / 9; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .post-card-media img { transform: scale(1.03); }
.post-card-body { padding-top: 14px; }
.post-card-title { font-size: 21px; line-height: 1.22; margin: 0 0 8px; }
.post-card p { color: var(--muted); font-size: 15.5px; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }

/* Post list (blog) */
.post-list { display: grid; }
.post-row { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); align-items: start; }
.post-row:first-child { padding-top: 4px; }
.post-row-title { font-size: 24px; line-height: 1.2; margin: 0 0 8px; }
.post-row p { color: var(--muted); margin-bottom: 10px; }
.post-thumb { display: block; border-radius: 12px; overflow: hidden; background: var(--bg-soft); aspect-ratio: 16 / 9; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-list.compact .post-row { grid-template-columns: minmax(0, 1fr) 180px; padding: 18px 0; }
.post-list.compact .post-row-title { font-size: 20px; }
@media (max-width: 640px) {
  .post-row, .post-list.compact .post-row { grid-template-columns: minmax(0, 1fr) 96px; gap: 14px; }
  .post-row-title, .post-list.compact .post-row-title { font-size: 19px; }
  .post-row p { display: none; }
}

/* Store band (home) */
.store-band {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); gap: clamp(24px, 3vw, 44px); align-items: center;
  padding: clamp(24px, 4vw, 44px); border-radius: var(--radius-lg); color: var(--band-text);
  background:
    radial-gradient(ellipse at 0% 0%, rgb(0 166 62 / 28%), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgb(245 73 0 / 24%), transparent 55%),
    var(--band);
  border: 1px solid var(--line);
}
.store-band h2 { color: #fafaf9; }
.store-band .eyebrow { color: #ff8904; }
.store-band p { color: #d6d3d1; }
.store-band .product-tile { background: rgb(255 255 255 / 6%); border-color: rgb(255 255 255 / 12%); }
.store-band .product-tile h3 a { color: #fafaf9; }
.store-band .product-tile p { color: #d6d3d1; }
.store-band .product-tile .price { color: #fafaf9; }
.store-band .product-tile .product-icon { background: rgb(255 255 255 / 10%); color: #05df72; }
.store-band .tile-demo { color: #7bf1a8; }
.store-band .product-tile:hover { border-color: rgb(255 255 255 / 30%); }
@media (max-width: 900px) { .store-band { grid-template-columns: 1fr; } }

/* How it works */
.how-band { padding: clamp(24px, 4vw, 40px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.how-band > h2 { font-size: 26px; }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 18px 0 20px; }
.how-item { position: relative; }
.how-item > .icon { color: var(--primary-text); margin-bottom: 10px; }
.how-item h3 { font-family: var(--font); font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.how-item p { color: var(--muted); font-size: 15.5px; margin: 0; }
.how-step { position: absolute; top: -2px; right: 0; font: 600 13px var(--mono); color: var(--secondary-text); }
.how-band-store .how-grid { margin-bottom: 0; }
@media (max-width: 760px) { .how-grid { grid-template-columns: 1fr; } }

/* Page heads, filters, search */
.page-head { padding: clamp(28px, 4vw, 48px) 0 clamp(16px, 2vw, 24px); }
.page-head h1 { margin: 8px 0 12px; }
.page-head .lead { margin-bottom: 20px; }
.page-head.narrow { max-width: 760px; }
.search-form { display: flex; align-items: center; gap: 8px; max-width: 560px; padding: 5px 5px 5px 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; margin-bottom: 16px; }
.search-form:focus-within { border-color: var(--primary-text); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-form > .icon { color: var(--muted); }
.search-form input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 400 16px var(--font); padding: 8px 4px; outline: none; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 550; }
.filter-chips a span { font: 500 12px var(--mono); color: var(--muted); }
.filter-chips a:hover { border-color: var(--ink); color: var(--ink); }
.filter-chips a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter-chips a[aria-current="page"] span { color: inherit; opacity: 0.75; }

/* Blog index layout */
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(28px, 4vw, 56px); padding-bottom: 64px; }
.blog-aside { display: grid; gap: 18px; align-content: start; position: sticky; top: 84px; }
.aside-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.aside-card h2 { font-size: 20px; margin-bottom: 8px; }
.aside-card p { color: var(--muted); font-size: 15px; }
.mini-products { list-style: none; padding: 0; margin: 0 0 14px; display: grid; }
.mini-products li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.mini-products li a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.mini-products li a:hover { color: var(--primary-text); }
.mini-products li > span { font: 500 13px var(--mono); color: var(--muted); }
.mini-products .product-icon { width: 28px; height: 28px; border-radius: 8px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 28px; }
@media (max-width: 960px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-aside { position: static; }
}

/* Empty states */
.empty-state { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.empty-state .icon { color: var(--primary-text); margin: 0 auto 10px; }
.empty-state h2 { font-size: 24px; }
.empty-state.big { border: 0; padding: clamp(56px, 10vw, 120px) 0; }
.empty-state.big h1 { margin: 10px auto 12px; max-width: 20ch; }
.empty-state.big p { max-width: 56ch; margin: 0 auto 26px; }
.empty-note { color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions.center { justify-content: center; }

/* Breadcrumbs */
.breadcrumbs { padding-top: 22px; font-size: 14px; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); }
.breadcrumbs li + li::before { content: '/'; margin-right: 6px; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary-text); }

/* Article */
.article { max-width: 760px; margin: 0 auto; padding: clamp(18px, 3vw, 32px) 0 24px; }
.article-head { margin-bottom: 24px; }
.article-head h1 { font-size: clamp(32px, 4.4vw, 48px); margin: 10px 0 14px; }
.dek { font-family: var(--serif); font-size: clamp(19px, 2vw, 22px); line-height: 1.5; color: var(--muted); margin-bottom: 16px; }
.article-hero { margin: 0 0 26px; }
.article-hero img { width: 100%; border-radius: var(--radius-lg); background: var(--bg-soft); aspect-ratio: 16 / 9; object-fit: cover; }
.article-hero figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
@media (min-width: 1100px) { .article-hero { margin-left: -80px; margin-right: -80px; } }
.translation-note { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 22px; background: var(--bg-soft); border-radius: 10px; font-size: 14px; color: var(--muted); }

/* Long-form text */
.prose { color: var(--text); max-width: 72ch; }
.prose > * + * { margin-top: 0; }
.prose h2 { font-size: clamp(24px, 2.4vw, 29px); margin: 1.7em 0 0.55em; }
.prose h3 { font-size: 21px; margin: 1.5em 0 0.5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin: 0.35em 0; padding-left: 0.2em; }
.prose ul li::marker { color: var(--primary-text); }
.prose ol li::marker { color: var(--primary-text); font-weight: 700; }
.prose strong { color: var(--ink); }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--secondary); font-family: var(--serif); font-size: 1.12em; font-style: italic; color: var(--ink); }
.prose pre { overflow-x: auto; padding: 16px 18px; background: var(--band); color: #e7e5e4; border-radius: 12px; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose img { border-radius: 12px; }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink); font-weight: 700; background: var(--bg-soft); }
.prose figure { margin: 1.8em 0; }
.prose figure img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.prose figcaption { margin-top: 8px; font: 400 13.5px/1.5 var(--font); color: var(--muted); }
.prose figcaption a { color: inherit; }
.prose-article { font-family: var(--serif); font-size: clamp(18.5px, 1.6vw, 20.5px); line-height: 1.72; max-width: none; }
.prose-article h2, .prose-article h3 { font-family: var(--serif); }
.prose-article li { padding-left: 0.1em; }
html:lang(ja) .prose-article { font-size: 17px; line-height: 1.95; }
html:lang(de) .prose-article, html:lang(fr) .prose-article { hyphens: auto; }

/* Closing product box inside an article */
.post-cta {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; margin: 36px 0 22px; padding: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
}
.post-cta-media { display: block; border-radius: 12px; overflow: hidden; align-self: start; background: var(--bg-soft); }
.post-cta-media img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.post-cta-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.post-cta-text h2 { font-size: 23px; margin: 0 0 8px; }
.post-cta-text p { font-size: 16px; color: var(--text); margin-bottom: 10px; }
.post-cta-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 700px) { .post-cta { grid-template-columns: 1fr; padding: 18px; } }
.source-box { margin: 22px 0; padding: 20px 22px; background: var(--bg-soft); border-radius: var(--radius); }
.source-box h2 { display: flex; align-items: center; gap: 8px; font-family: var(--font); font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.source-box p { font-size: 15px; color: var(--muted); }
.tag-list { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a { display: inline-block; padding: 4px 11px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); font: 500 13px var(--mono); text-decoration: none; }
.tag-list a:hover { color: var(--primary-text); }
.store-strip { max-width: 1000px; margin: 0 auto; }
.article ~ .section { max-width: 1000px; margin: 0 auto; }

/* Products */
.product-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft, var(--primary-soft)); color: var(--accent); }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: var(--secondary-soft); color: var(--secondary-text); font: 600 12px/1.4 var(--font); white-space: nowrap; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 3px 10px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.price { font: 600 17px var(--font); color: var(--ink); }
.price-muted { color: var(--muted); font-size: 15px; }
.product-group { margin-bottom: 44px; }
.group-head { margin-bottom: 18px; }
.group-head h2 { margin-bottom: 4px; }
.group-head p { color: var(--muted); margin: 0; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.product-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.product-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card-media { display: block; background: var(--bg-soft); aspect-ratio: 2 / 1; overflow: hidden; }
.product-card-media img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body { padding: 18px 20px 10px; flex: 1; }
.product-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.product-card-top .badge { margin-left: auto; }
.product-card-title { font-size: 23px; margin: 0 0 6px; }
.product-card-title a { color: var(--ink); text-decoration: none; }
.product-card-title a:hover { color: var(--primary-text); }
.product-card-body > p { color: var(--muted); font-size: 15.5px; }
.product-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.card-actions { display: flex; align-items: center; gap: 14px; font-size: 14.5px; }
.card-actions a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); text-decoration: none; font-weight: 550; }
.card-actions a:hover { color: var(--primary-text); }
.card-actions a.strong { color: var(--primary-text); font-weight: 650; }
@media (max-width: 960px) { .product-grid, .product-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .product-grid, .product-grid.two { grid-template-columns: 1fr; } }

.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.section > .wrap > .tile-grid, .store-strip .tile-grid, .product-page .tile-grid, .section > .tile-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.product-tile { position: relative; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.product-tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.product-tile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.product-tile h3 { font-size: 19px; margin: 0 0 4px; }
.product-tile h3 a { color: var(--ink); text-decoration: none; }
.product-tile p { font-size: 14.5px; color: var(--muted); margin: 0 0 8px; }
.tile-demo { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; text-decoration: none; }
@media (max-width: 560px) { .tile-grid { grid-template-columns: 1fr; } }

.demo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.demo-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.demo-link > span { display: grid; flex: 1; min-width: 0; }
.demo-link strong { font-weight: 650; }
.demo-link small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-link > .icon:last-child { color: var(--muted); }
.demo-link:hover { border-color: var(--accent, var(--primary-text)); color: var(--ink); }
.demo-link > .icon:first-child { color: var(--accent, var(--primary-text)); }

/* Product page */
.product-hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(28px, 4vw, 56px); padding: 20px 0 34px; align-items: start; }
.product-title { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.product-title .product-icon { width: 58px; height: 58px; border-radius: 16px; }
.product-title h1 { margin: 4px 0 0; }
.product-hero-copy .lead { color: var(--ink); font-family: var(--serif); font-size: clamp(20px, 2vw, 24px); line-height: 1.4; margin-bottom: 12px; }
.product-hero-copy > p { color: var(--muted); }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.meta-label { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); min-width: 90px; }
.buy-card { position: sticky; top: 84px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.buy-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.price-lg { font: 750 40px/1 var(--font); letter-spacing: -0.03em; color: var(--ink); }
.buy-price span:last-child { color: var(--muted); font-size: 14px; }
.buy-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.buy-tiers > div { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.buy-tiers .price-lg { font-size: 30px; }
.tier-name { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.buy-note { color: var(--muted); font-size: 14.5px; }
.buy-note.small { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 10px 0 14px; }
.buy-actions { display: grid; gap: 8px; }
.buy-status { display: grid; gap: 10px; justify-items: start; margin-bottom: 10px; }
.buy-status h2 { font-size: 24px; margin: 0; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; border-top: 1px solid var(--line); padding-top: 14px; }
.checklist li { display: flex; gap: 10px; font-size: 14.5px; color: var(--text); }
.checklist .icon { color: var(--primary-text); margin-top: 3px; }
.product-cover { margin: 0 0 12px; }
.product-cover img { width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--bg-soft); }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feature h3 { font-family: var(--font); font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 15.5px; margin: 0; }
.product-body .prose { max-width: 760px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-soft); }
.gallery figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.gallery-phone { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.demo-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: clamp(22px, 3vw, 36px); background: var(--accent-soft, var(--primary-soft)); border-radius: var(--radius-lg); }
.demo-band h2 { margin-bottom: 8px; }
.demo-band p { color: var(--muted); margin: 0; }
.demo-band-links { display: grid; gap: 10px; }
.faq-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 650; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 500 20px/1 var(--mono); color: var(--primary-text); }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding: 0 18px 16px; margin: 0; color: var(--muted); }
.buy-bar { position: sticky; bottom: 0; z-index: 40; display: none; background: var(--header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.buy-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 960px) {
  .product-hero { grid-template-columns: 1fr; }
  .buy-card { position: static; }
  .feature-grid, .feature-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-band, .faq-layout { grid-template-columns: 1fr; }
  .buy-bar { display: block; }
}
@media (max-width: 600px) {
  .feature-grid, .feature-grid.two-up, .gallery { grid-template-columns: 1fr; }
}

/* Static pages */
.page-layout { padding-bottom: 64px; }
.page-layout .prose { max-width: 760px; }
.page-about { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0 clamp(28px, 4vw, 56px); align-items: start; }
.page-about .page-head, .page-about .stat-row { grid-column: 1 / -1; }
.about-products { position: sticky; top: 84px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 32px; }
.stat-row > div { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat-row strong { display: block; font: 750 32px/1.1 var(--font); color: var(--ink); letter-spacing: -0.03em; }
.stat-row span { color: var(--muted); font-size: 14px; }
@media (max-width: 900px) {
  .page-about { grid-template-columns: 1fr; }
  .about-products { position: static; margin-top: 24px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Footer */
.site-footer { margin-top: 32px; padding: 48px 0 28px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-brand p { color: var(--muted); font-size: 15px; margin: 14px 0; max-width: 34ch; }
.footer-mail { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; }
.site-footer h2 { font: 700 13px/1.4 var(--font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer ul a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-footer ul a:hover { color: var(--primary-text); }
.footer-langs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.footer-langs a { color: var(--muted); text-decoration: none; }
.footer-langs a[aria-current="true"] { color: var(--primary-text); font-weight: 700; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin-top: 18px; color: var(--muted); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Cookie consent banner (public/assets/analytics.js; shown in the EEA, UK and Switzerland) */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; max-width: 560px; margin: 0 auto; display: grid; gap: 12px; padding: 16px 18px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 14.5px; line-height: 1.5; }
.consent p { margin: 0; }
.consent-actions { display: flex; justify-content: flex-end; gap: 8px; }
[data-consent-open][hidden] { display: none; }
