/* openab.dev — light theme taken from the OpenAB banner: lavender field (#EBE9F7)
   and the wordmark's deep violet (#3D1F79). Structure follows connect.openab.dev
   (nav, hero, card grid, footer); the product cards follow tautiu.dev. */
:root {
  --accent: #7B62C9;
  --accent-deep: #3D1F79;
  --accent-tint: #ECE6F8;
  --brush: rgba(173, 159, 208, 0.55);
  --ink: #221640;
  --muted: #615A78;
  --bg: #F7F4FC;
  --card: #FFFFFF;
  --border: rgba(61, 31, 121, 0.14);
  --shadow: 0 4px 20px rgba(61, 31, 121, 0.08);
  --shadow-hover: 0 14px 34px rgba(61, 31, 121, 0.16);
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #B9A6EE;
    --accent-deep: #D6CAFA;
    --accent-tint: #2A2244;
    --brush: rgba(185, 166, 238, 0.35);
    --ink: #F3EFFD;
    --muted: #B3AAC9;
    --bg: #14101F;
    --card: #1E1830;
    --border: rgba(214, 202, 250, 0.16);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-deep); }

/* Per-language CJK stacks, as on connect.openab.dev. */
html[data-lang="zh"] body {
  font-family: "PingFang TC", "Heiti TC", "Noto Sans TC", -apple-system,
               BlinkMacSystemFont, system-ui, sans-serif;
}
html[data-lang="ja"] body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
               -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
/* Korean has spaces between words, so break there rather than inside a word. */
html[data-lang="ko"] body {
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", -apple-system,
               BlinkMacSystemFont, system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}

/* ── Nav ─────────────────────────────── */
nav.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  max-width: 1040px; margin: 0 auto; padding: 20px 24px;
}
/* Wordmark pinned to one Latin stack so it keeps its shape on every language page. */
nav .brand {
  display: flex; align-items: center; gap: 7px;
  font-weight: 700; text-decoration: none; color: var(--ink); font-size: 1.05rem;
  letter-spacing: -0.015em;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
nav .brand img { width: 26px; height: 26px; border-radius: 7px; }
nav .links { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; font-size: 0.95rem; }
nav .links a { text-decoration: none; color: var(--muted); }
nav .links a:hover { color: var(--ink); }
nav .lang { margin-left: 0.6rem; font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
nav .lang a { margin: 0 0.15rem; text-decoration: none; color: var(--muted); }
nav .lang a.active { color: var(--ink); font-weight: 700; }

/* ── Hero ────────────────────────────── */
header.hero { max-width: 900px; margin: 0 auto; padding: 40px 24px 8px; text-align: center; }
.hero .logo {
  width: 144px; height: 144px; border-radius: 34px;
  box-shadow: var(--shadow);
  animation: bob 5s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(-2deg); }
}
.kicker {
  margin: 22px 0 0; color: var(--accent-deep);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
}
h1 {
  font-size: clamp(1.2rem, 5.4vw, 3.4rem); font-weight: 800;
  margin: 8px 0 12px; letter-spacing: -0.022em; line-height: 1.2;
}
.tag { color: var(--muted); font-size: 1.12rem; margin: 0 auto; max-width: 36em; }
h1, .tag { text-wrap: balance; }
/* Han glyphs fill the em box: larger, heavier, no negative tracking. The floor is
   derived from a ~342px measure at 390px over the longest authored line. */
html[data-lang="zh"] h1,
html[data-lang="ja"] h1,
html[data-lang="ko"] h1 {
  font-size: clamp(1.4rem, 6.2vw, 3rem);
  letter-spacing: 0.01em; line-height: 1.3;
}
html[data-lang="zh"] .tag,
html[data-lang="ja"] .tag,
html[data-lang="ko"] .tag { font-size: 1.1rem; line-height: 1.8; max-width: 28em; }

.mark {
  background: linear-gradient(transparent 58%, var(--brush) 58%,
                              var(--brush) 94%, transparent 94%);
  padding: 0 0.08em;
}

.cta { margin: 26px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; font-weight: 700; font-size: 0.97rem; text-decoration: none;
  color: var(--accent-deep); background: var(--card);
  border: 1px solid var(--border); border-radius: 999px; padding: 9px 20px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.btn.primary { color: #fff; background: var(--accent-deep); border-color: var(--accent-deep); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #14101F; } }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(61, 31, 121, 0.14); }
.btn:focus-visible { outline: 3px solid var(--brush); outline-offset: 3px; }

/* ── Products ────────────────────────── */
section.products { max-width: 1040px; margin: 0 auto; padding: 3.5rem 24px 0; }
section h2 { text-align: center; font-size: 1.5rem; margin: 0 0 0.4rem; }
html[data-lang="zh"] section h2,
html[data-lang="ja"] section h2,
html[data-lang="ko"] section h2 { font-size: 1.6rem; }
.intro { text-align: center; color: var(--muted); max-width: 38em; margin: 0 auto 1.8rem; text-wrap: balance; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px;
}
.card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 22px; padding: 24px;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-5px); box-shadow: var(--shadow-hover);
  border-color: var(--accent); outline: none;
}
.card-head { display: flex; align-items: center; gap: 14px; }
.card-icon { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; }
img.card-icon { box-shadow: 0 2px 8px rgba(61, 31, 121, 0.14); }
.card-icon.tile {
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
}
.card-icon.tile svg {
  width: 28px; height: 28px; fill: none; stroke: var(--accent);
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
@media (prefers-color-scheme: dark) {
  .card-icon.tile svg { stroke: color-mix(in srgb, var(--accent) 45%, #fff); }
}
.card-name {
  margin: 0; font-size: 1.22rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
.card-role {
  display: inline-block; margin-top: 4px;
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  background: var(--accent-tint); border-radius: 999px; padding: 1px 10px;
}
.card-desc { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.65; }
.card-for { margin: 0; font-size: 0.93rem; line-height: 1.6; }
.card-for strong { color: var(--accent-deep); margin-right: 0.25em; }
.card-tags { margin: auto 0 0; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.01em; }
.card-link {
  font-size: 0.88rem; font-weight: 700; color: var(--accent); overflow-wrap: anywhere;
}
@media (prefers-color-scheme: dark) {
  .card-link { color: color-mix(in srgb, var(--accent) 45%, #fff); }
}
.card-link::after { content: " →"; }
html[data-lang="zh"] .card-desc,
html[data-lang="ja"] .card-desc,
html[data-lang="ko"] .card-desc,
html[data-lang="zh"] .card-for,
html[data-lang="ja"] .card-for,
html[data-lang="ko"] .card-for { font-size: 0.97rem; line-height: 1.8; }

/* ── Community ───────────────────────── */
section.community {
  max-width: 640px; margin: 3.5rem auto 0; padding: 2rem 24px;
  text-align: center;
}
section.community p { color: var(--muted); margin: 0 0 1.2rem; }

footer {
  max-width: 1040px; margin: 40px auto 0; padding: 26px 24px 48px;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.9rem;
  display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; align-items: center;
}
footer a { color: var(--muted); }
.dim { color: var(--muted); }

@media (max-width: 620px) {
  nav.top { flex-direction: column; align-items: center; gap: 8px; padding: 14px 18px; }
  nav .links { justify-content: center; gap: 0.85rem; font-size: 0.9rem; }
  nav .lang { margin-left: 0; }
  header.hero { padding: 24px 18px 4px; }
  .hero .logo { width: 112px; height: 112px; border-radius: 27px; }
  .tag { font-size: 1.02rem; }
  section.products { padding: 2.6rem 16px 0; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero .logo { animation: none; }
  .card, .btn { transition: none; }
}
