/* Base styles shared by every Robokade page. Desktop first (D29), phones must work (D28). */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--mc-bg);
  color: var(--mc-text);
  font-family: var(--mc-font);
  font-size: 17px;
  line-height: 1.55;
}

a { color: var(--mc-blue); }
a:hover { color: var(--mc-violet); }
:focus-visible { outline: 3px solid var(--mc-focus); outline-offset: 2px; border-radius: 4px; }

.chroma-bar { height: 6px; background: var(--mc-chroma); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

header.site {
  display: flex; align-items: center; justify-content: space-between; gap: var(--mc-gap);
  padding: 20px 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mc-font-brand); font-weight: 600; font-size: 21px; text-decoration: none; color: var(--mc-text); }
.brand img { width: 32px; height: 32px; }

.hero { padding: 56px 0 32px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.08; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero h1 .chroma-text {
  background: var(--mc-chroma);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(18px, 2.2vw, 22px); color: var(--mc-text-muted); max-width: 680px; margin: 0 0 24px; }

.badge {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--mc-surface-2); color: var(--mc-violet); font-weight: 700; font-size: 14px;
}

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--mc-gap); margin: 32px 0; }
.card {
  background: var(--mc-surface); border: 1px solid var(--mc-border); border-radius: var(--mc-radius);
  padding: 22px; box-shadow: var(--mc-shadow);
}
.card h2 { font-size: 20px; margin: 10px 0 8px; }
.card p { margin: 0; color: var(--mc-text-muted); }
.card .dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.dot.m { background: var(--mc-magenta); }
.dot.c { background: var(--mc-cyan); }
.dot.y { background: var(--mc-yellow); }

.links { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 48px; }
.button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px;
  border-radius: 999px; border: 2px solid var(--mc-text); color: var(--mc-text);
  font-weight: 700; text-decoration: none; background: var(--mc-surface);
}
.button:hover { background: var(--mc-yellow); color: var(--mc-text); }
.button.primary { background: var(--mc-text); color: #fff; }
.button.primary:hover { background: var(--mc-violet); color: #fff; border-color: var(--mc-violet); }
.button[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
button.button { font: inherit; font-weight: 700; cursor: pointer; }

.prose { max-width: 720px; padding: 32px 0 56px; }
.prose h1 { font-size: 34px; line-height: 1.15; }
.prose h2 { font-size: 22px; margin-top: 32px; }
.prose code { font-family: var(--mc-font-mono); background: var(--mc-surface-2); padding: 1px 6px; border-radius: 6px; }

footer.site { border-top: 1px solid var(--mc-border); padding: 24px 0 40px; color: var(--mc-text-muted); font-size: 15px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 18px; }

@media (max-width: 767px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding: 32px 0 16px; }
  .cards { grid-template-columns: 1fr; }
}

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

/* Languages (PLAN_I18N §5, D123). i18n-boot.js hides the body until the catalog is applied (800 ms at most). */
html.i18n-wait body { visibility: hidden; }
:lang(zh-TW) { letter-spacing: 0; }
html:lang(zh-TW) body { line-height: 1.7; }
:lang(zh-TW) .hero h1 { letter-spacing: 0; line-height: 1.2; }
.mc-lang { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; color: var(--mc-text-muted); }
.mc-lang-btn { font: inherit; font-weight: 700; color: var(--mc-text); background: none; border: 0; padding: 8px 2px; cursor: pointer; }
.mc-lang-btn:hover { color: var(--mc-violet); }
.mc-lang-btn[aria-current="true"] { color: var(--mc-violet); text-decoration: underline; text-underline-offset: 4px; }
.mc-en-only { margin: 8px 0 0; padding: 8px 12px; border-radius: var(--mc-radius-sm); background: var(--mc-surface-2); color: var(--mc-text-muted); font-size: 15px; }
.mc-notice { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin: 8px 0 16px; padding: 10px 14px; border-radius: var(--mc-radius-sm); background: var(--mc-surface-2); font-size: 15px; }
.mc-notice p { margin: 0; }
.mc-notice-close { font: inherit; font-weight: 700; background: none; border: 0; color: var(--mc-violet); cursor: pointer; padding: 0 4px; white-space: nowrap; }

/* Busy buttons (kit/shell/busy.js; id.js and admin.js have copies): disabled from the click until the action ends,
   with a small spinner after the label. Under prefers-reduced-motion the ring stays still. */
.mc-busy { cursor: progress !important; }
.mc-busy::after { content: ""; display: inline-block; width: 0.85em; height: 0.85em; margin-left: 0.5em; vertical-align: -0.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: mc-spin 0.7s linear infinite; }
@keyframes mc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mc-busy::after { animation: none; } }
