/* SBC Project Manager — user guide */

:root {
  --brand: #f5a30c;
  --brand-strong: #d98400;
  --brand-soft: #fff4d6;
  --brand-glow: rgba(250, 172, 24, 0.35);
  --bg: #fbfaf7;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f4f2ec;
  --surface-sunken: #efece4;
  --ink: #16151a;
  --ink-muted: #55535c;
  --ink-subtle: #85838c;
  --line: #e7e3d9;
  --line-strong: #d6d1c4;
  --blue: #3b82f6;
  --green: #16a34a;
  --red: #e5484d;
  --violet: #7c5cff;
  --blue-soft: #e7f0ff;
  --green-soft: #e3f6ea;
  --red-soft: #fde8e8;
  --violet-soft: #efeaff;
  --shadow-sm: 0 1px 2px rgba(22, 21, 26, 0.06), 0 1px 1px rgba(22, 21, 26, 0.04);
  --shadow-md: 0 8px 24px -8px rgba(22, 21, 26, 0.14), 0 2px 6px rgba(22, 21, 26, 0.05);
  --shadow-lg: 0 30px 60px -20px rgba(22, 21, 26, 0.25), 0 8px 20px -8px rgba(22, 21, 26, 0.12);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 64px;
  --sidebar-w: 276px;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Plus Jakarta Sans", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #fbb52c;
    --brand-strong: #ffc94d;
    --brand-soft: rgba(251, 181, 44, 0.12);
    --brand-glow: rgba(251, 181, 44, 0.22);
    --bg: #0d0d10;
    --bg-elevated: #141418;
    --surface: #17171c;
    --surface-muted: #1d1d23;
    --surface-sunken: #111114;
    --ink: #f3f2ee;
    --ink-muted: #b4b2ba;
    --ink-subtle: #807e88;
    --line: #2a2a31;
    --line-strong: #3a3a43;
    --blue-soft: rgba(59, 130, 246, 0.14);
    --green-soft: rgba(22, 163, 74, 0.16);
    --red-soft: rgba(229, 72, 77, 0.16);
    --violet-soft: rgba(124, 92, 255, 0.16);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 40px 80px -24px rgba(0, 0, 0, 0.75), 0 10px 24px -10px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --brand: #fbb52c;
  --brand-strong: #ffc94d;
  --brand-soft: rgba(251, 181, 44, 0.12);
  --brand-glow: rgba(251, 181, 44, 0.22);
  --bg: #0d0d10;
  --bg-elevated: #141418;
  --surface: #17171c;
  --surface-muted: #1d1d23;
  --surface-sunken: #111114;
  --ink: #f3f2ee;
  --ink-muted: #b4b2ba;
  --ink-subtle: #807e88;
  --line: #2a2a31;
  --line-strong: #3a3a43;
  --blue-soft: rgba(59, 130, 246, 0.14);
  --green-soft: rgba(22, 163, 74, 0.16);
  --red-soft: rgba(229, 72, 77, 0.16);
  --violet-soft: rgba(124, 92, 255, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 40px 80px -24px rgba(0, 0, 0, 0.75), 0 10px 24px -10px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

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

a {
  color: var(--brand-strong);
  text-decoration: none;
  text-underline-offset: 3px;
}

:root[data-theme="light"] a,
:root:not([data-theme]) a {
  color: #b36b00;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) a {
    color: var(--brand-strong);
  }
}

:root[data-theme="dark"] a {
  color: var(--brand-strong);
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  font-weight: 750;
  margin-top: 3.2rem;
  margin-bottom: 0.9rem;
}

h3 {
  font-size: 1.18rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.3rem;
}

li {
  margin: 0.3rem 0;
}

li::marker {
  color: var(--brand);
}

strong {
  font-weight: 650;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 3rem 0;
}

kbd {
  display: inline-flex;
  align-items: center;
  min-width: 1.6em;
  justify-content: center;
  padding: 0.05em 0.45em;
  font-family: var(--font-mono);
  font-size: 0.78em;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
}

.ui {
  display: inline;
  padding: 0.06em 0.45em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  font-size: 0.88em;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg) !important;
  border-radius: 10px;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink) !important;
  text-decoration: none !important;
  min-width: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover img {
  transform: rotate(-8deg) scale(1.06);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 750;
  white-space: nowrap;
}

.brand-text span {
  font-size: 0.74rem;
  color: var(--ink-subtle);
  white-space: nowrap;
}

.header-spacer {
  flex: 1;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px 0 12px;
  min-width: 240px;
  color: var(--ink-subtle);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-trigger:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.search-trigger kbd {
  margin-left: auto;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.icon-button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.open-app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  font-weight: 650;
  font-size: 0.9rem;
  color: #1a1204 !important;
  background: linear-gradient(135deg, #ffca05, #faac18);
  border-radius: 12px;
  text-decoration: none !important;
  box-shadow: 0 6px 16px -6px var(--brand-glow);
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.open-app:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -8px var(--brand-glow);
}

.menu-button {
  display: none;
}

.theme-toggle .sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .moon {
    display: none;
  }
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 24px 16px 40px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}

.nav-group + .nav-group {
  margin-top: 22px;
}

.nav-group h2 {
  margin: 0 0 6px;
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin: 1px 0;
  color: var(--ink-muted) !important;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 10px;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--surface-muted);
  color: var(--ink) !important;
}

.nav-link[aria-current="page"] {
  color: var(--ink) !important;
  background: var(--brand-soft);
  font-weight: 650;
}

.nav-link .nav-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nav-link[aria-current="page"] .nav-icon {
  border-color: transparent;
  background: linear-gradient(135deg, #ffca05, #faac18);
}

.sidebar-card {
  margin-top: 28px;
  padding: 16px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-muted);
  background: linear-gradient(160deg, var(--brand-soft), transparent 70%), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sidebar-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 48px;
  padding: 40px clamp(16px, 4vw, 56px) 80px;
  max-width: 1240px;
}

.main.wide {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1180px;
}

.article {
  min-width: 0;
  max-width: 780px;
}

.main.wide .article {
  max-width: none;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 64px);
  overflow-y: auto;
  font-size: 0.84rem;
}

.toc p {
  margin: 0 0 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.toc a {
  display: block;
  padding: 5px 0 5px 12px;
  color: var(--ink-subtle) !important;
  border-left: 2px solid var(--line);
  text-decoration: none !important;
  transition: color 0.2s, border-color 0.2s;
}

.toc a:hover {
  color: var(--ink) !important;
}

.toc a.is-active {
  color: var(--ink) !important;
  border-left-color: var(--brand);
  font-weight: 600;
}

/* ---------- Page hero ---------- */

.page-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin-bottom: 2rem;
  padding: 36px;
  background:
    radial-gradient(120% 120% at 100% 0%, var(--brand-soft), transparent 55%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--brand-glow), transparent 65%);
  z-index: -1;
  animation: glow-drift 9s ease-in-out infinite alternate;
}

.page-hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 4px 12px 4px 6px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.page-hero .kicker span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 0.8rem;
  background: linear-gradient(135deg, #ffca05, #faac18);
  border-radius: 999px;
}

.page-hero h1 {
  margin-bottom: 14px;
}

.lede {
  font-size: 1.12rem;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-bottom: 0;
}

.page-hero .illustration {
  max-width: 300px;
  justify-self: center;
}

.illustration {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 30px rgba(22, 21, 26, 0.16));
  animation: float 6s ease-in-out infinite;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* ---------- Landing hero ---------- */

.landing-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  padding: 56px 0 24px;
}

.landing-hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(100deg, #f59e0b 0%, #ffca05 40%, #f97316 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  font-weight: 650;
  border-radius: 14px;
  text-decoration: none !important;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.button.primary {
  color: #1a1204 !important;
  background: linear-gradient(135deg, #ffca05, #faac18);
  box-shadow: 0 12px 28px -10px var(--brand-glow);
}

.button.secondary {
  color: var(--ink) !important;
  background: var(--surface);
  border: 1px solid var(--line);
}

.button:hover {
  transform: translateY(-2px);
}

.button.secondary:hover {
  box-shadow: var(--shadow-md);
}

.hero-stage {
  position: relative;
  min-height: 420px;
}

.hero-stage .illustration {
  position: absolute;
  width: 58%;
  right: -4%;
  bottom: -6%;
  z-index: 2;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 36px 0 8px;
}

.stat {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat span {
  font-size: 0.86rem;
  color: var(--ink-muted);
}

.section-head {
  margin: 4.5rem 0 1.6rem;
  text-align: center;
}

.section-head h2 {
  margin: 0 0 10px;
}

.section-head p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--ink-muted);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-strong);
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin: 1.4rem 0 2rem;
}

.card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  color: var(--ink) !important;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none !important;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, border-color 0.25s;
  overflow: hidden;
}

a.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

a.card::after {
  content: "→";
  position: absolute;
  right: 18px;
  top: 18px;
  color: var(--ink-subtle);
  transition: transform 0.25s, color 0.25s;
}

a.card:hover::after {
  transform: translateX(4px);
  color: var(--brand-strong);
}

.card h3 {
  margin: 6px 0 0;
  font-size: 1.04rem;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  border-radius: 12px;
  background: var(--brand-soft);
}

.card-icon.blue {
  background: var(--blue-soft);
}

.card-icon.green {
  background: var(--green-soft);
}

.card-icon.red {
  background: var(--red-soft);
}

.card-icon.violet {
  background: var(--violet-soft);
}

.card .route {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-subtle);
}

.card.with-art {
  padding: 0;
}

.card.with-art .art {
  display: grid;
  place-items: center;
  height: 170px;
  background: linear-gradient(160deg, var(--brand-soft), var(--surface-muted));
}

.card.with-art .art img {
  height: 150px;
  width: auto;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

a.card.with-art:hover .art img {
  transform: scale(1.06) rotate(-2deg);
}

.card.with-art .body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 20px;
}

/* ---------- Feature rows ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  align-items: center;
  gap: 32px;
  margin: 2.2rem 0;
}

.feature.reverse {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
}

.feature.reverse > :first-child {
  order: 2;
}

.feature h2,
.feature h3 {
  margin-top: 0;
}

.art-panel {
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(80% 80% at 50% 40%, var(--brand-soft), transparent 70%),
    var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.art-panel img {
  max-height: 280px;
  width: auto;
}

/* ---------- Callouts ---------- */

.callout {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  margin: 1.4rem 0;
  padding: 16px 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
}

.callout .callout-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  background: var(--brand-soft);
  border-radius: 10px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout > div > strong:first-child {
  display: block;
  margin-bottom: 2px;
}

.callout.tip {
  border-left-color: var(--green);
}

.callout.tip .callout-icon {
  background: var(--green-soft);
}

.callout.note {
  border-left-color: var(--blue);
}

.callout.note .callout-icon {
  background: var(--blue-soft);
}

.callout.admin {
  border-left-color: var(--violet);
}

.callout.admin .callout-icon {
  background: var(--violet-soft);
}

.callout.warn {
  border-left-color: var(--red);
}

.callout.warn .callout-icon {
  background: var(--red-soft);
}

/* ---------- Steps ---------- */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1.4rem 0 2rem;
}

.steps > li {
  position: relative;
  counter-increment: step;
  padding: 0 0 22px 52px;
  margin: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  color: #1a1204;
  background: linear-gradient(135deg, #ffca05, #faac18);
  border-radius: 11px;
  box-shadow: 0 6px 14px -6px var(--brand-glow);
}

.steps > li::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 40px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--line-strong), transparent);
}

.steps > li:last-child::after {
  display: none;
}

.steps > li > strong:first-child {
  display: block;
  padding-top: 4px;
  font-family: var(--font-display);
  font-size: 1.02rem;
}

/* ---------- Tables ---------- */

.table-wrap {
  margin: 1.2rem 0 2rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  background: var(--surface-muted);
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: var(--surface-muted);
}

td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Module map ---------- */

.lifecycle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 1.6rem 0 2rem;
}

.phase {
  position: relative;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.phase::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--phase-color, var(--brand));
}

.phase .phase-step {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.phase h3 {
  margin: 4px 0 4px;
  font-size: 1.05rem;
}

.phase p {
  margin: 0 0 12px;
}

.phase p:last-child {
  margin-bottom: 0;
  font-size: 0.86rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.2s;
}

a.chip:hover {
  background: var(--brand-soft);
  transform: translateY(-1px);
}

/* ---------- Demo window ---------- */

.demo {
  margin: 1.8rem 0 2.2rem;
}

.demo figcaption {
  margin-top: 10px;
  font-size: 0.84rem;
  color: var(--ink-subtle);
  text-align: center;
}

.window {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
}

.window-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}

.window-bar i:nth-child(2) {
  background: #febc2e;
}

.window-bar i:nth-child(3) {
  background: #28c840;
}

.window-bar .address {
  flex: 1;
  max-width: 280px;
  margin: 0 auto;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--ink-subtle);
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.window-body {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 300px;
}

.mini-sidebar {
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.mini-sidebar span {
  display: block;
  height: 8px;
  margin: 10px 4px;
  border-radius: 4px;
  background: var(--line);
}

.mini-sidebar span.active {
  background: var(--brand);
  width: 70%;
}

.mini-sidebar .logo {
  width: 26px;
  height: 26px;
  margin: 2px 4px 16px;
}

.window-content {
  padding: 14px;
  min-width: 0;
}

.window-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.window-title .badge {
  padding: 2px 8px;
  font-size: 0.68rem;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
}

/* Kanban */
.kanban {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.kanban-col {
  min-height: 210px;
  padding: 8px;
  background: var(--surface-muted);
  border-radius: 10px;
}

.kanban-col h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 2px 8px;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.kanban-col h4::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot, var(--ink-subtle));
}

.task {
  margin-bottom: 7px;
  padding: 8px 9px;
  font-size: 0.7rem;
  line-height: 1.35;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.task b {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--ink-subtle);
}

.task .tag {
  display: inline-block;
  margin-top: 5px;
  padding: 1px 6px;
  font-size: 0.6rem;
  font-weight: 650;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.task .tag.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.task .tag.red {
  background: var(--red-soft);
  color: var(--red);
}

.toast {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.toast.is-shown {
  opacity: 1;
  transform: none;
}

.toast .xp {
  padding: 2px 7px;
  color: #1a1204;
  background: linear-gradient(135deg, #ffca05, #faac18);
  border-radius: 999px;
}

/* Command palette */
.palette {
  max-width: 520px;
  margin: 0 auto;
  padding: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--line);
}

.palette-input .typed {
  position: relative;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--brand);
  width: 0;
  animation: typing 6s steps(14) infinite, caret 0.8s step-end infinite;
}

.palette-input .typed {
  font-family: var(--font-sans);
}

.palette ul {
  list-style: none;
  margin: 0;
  padding: 8px;
}

.palette li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px 10px;
  font-size: 0.86rem;
  border-radius: 10px;
}

.palette li small {
  margin-left: auto;
  color: var(--ink-subtle);
  font-size: 0.74rem;
}

.palette li.hit {
  animation: palette-hit 6s ease infinite;
}

.palette li .li-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--surface-muted);
  border-radius: 8px;
}

/* Gantt */
.gantt {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  font-size: 0.72rem;
}

.gantt-label {
  display: flex;
  align-items: center;
  height: 38px;
  padding-right: 8px;
  color: var(--ink-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-track {
  position: relative;
  height: 38px;
  border-left: 1px solid var(--line);
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 12.5% 100%;
}

.gantt-bar {
  position: absolute;
  top: 10px;
  height: 18px;
  left: var(--start);
  width: var(--width);
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bar, var(--blue)), color-mix(in srgb, var(--bar, var(--blue)) 75%, white));
  transform-origin: left center;
  animation: bar-grow 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--delay, 0s);
}

.gantt-bar.critical {
  --bar: var(--red);
}

.gantt-baseline {
  position: absolute;
  top: 30px;
  height: 4px;
  left: var(--start);
  width: var(--width);
  border-radius: 2px;
  background: var(--ink-subtle);
  opacity: 0.4;
}

.gantt-milestone {
  position: absolute;
  top: 11px;
  left: var(--start);
  width: 16px;
  height: 16px;
  background: var(--brand);
  transform: rotate(45deg);
  border-radius: 3px;
  animation: pop-in 0.6s 1.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(120px + (100% - 120px) * 0.46);
  width: 2px;
  background: var(--brand);
  z-index: 2;
}

.gantt-today::before {
  content: "Today";
  position: absolute;
  top: -20px;
  left: -16px;
  padding: 1px 6px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #1a1204;
  background: var(--brand);
  border-radius: 4px;
}

.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.gantt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gantt-legend i {
  width: 18px;
  height: 8px;
  border-radius: 3px;
  background: var(--blue);
}

/* Budget */
.budget {
  display: grid;
  gap: 14px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpi {
  padding: 12px;
  background: var(--surface-muted);
  border-radius: 12px;
}

.kpi span {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.kpi strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.kpi.good strong {
  color: var(--green);
}

.meter {
  display: flex;
  height: 16px;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: 999px;
}

.meter i {
  height: 100%;
  width: var(--w);
  background: var(--c);
  transform-origin: left;
  animation: bar-grow 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--delay, 0s);
}

.meter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

.meter-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meter-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c);
}

.s-curve {
  width: 100%;
  height: 120px;
}

.s-curve path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: draw 2.4s ease forwards;
}

.s-curve .pv {
  stroke: var(--ink-subtle);
  stroke-dasharray: 6 6;
  animation: none;
  stroke-dashoffset: 0;
  opacity: 0.6;
}

.s-curve .ev {
  stroke: var(--green);
}

.s-curve .ac {
  stroke: var(--brand);
  animation-delay: 0.4s;
}

/* Notifications */
.toast-stack {
  position: relative;
  overflow-x: clip;
  overflow-clip-margin: 24px;
  display: grid;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}

.notice {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  animation: notice-in 9s ease infinite;
  animation-delay: var(--delay, 0s);
}

.notice .n-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  border-radius: 11px;
  background: var(--brand-soft);
}

.notice strong {
  display: block;
  font-size: 0.84rem;
}

.notice span {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-muted);
  line-height: 1.4;
}

.notice small {
  font-size: 0.68rem;
  color: var(--ink-subtle);
}

.channels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.channel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.channel i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: ping 2s ease-out infinite;
  animation-delay: var(--delay, 0s);
}

/* Risk heat map */
.heatmap {
  display: grid;
  grid-template-columns: 26px repeat(5, minmax(0, 1fr));
  gap: 5px;
  max-width: 420px;
  margin: 0 auto;
  font-size: 0.66rem;
  color: var(--ink-subtle);
}

.heatmap .cell {
  position: relative;
  aspect-ratio: 1.5;
  border-radius: 7px;
  background: var(--heat);
}

.heatmap .axis {
  display: grid;
  place-items: center;
  font-weight: 700;
}

.heatmap .risk-dot {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #16151a;
  box-shadow: 0 0 0 0 rgba(22, 21, 26, 0.4);
  animation: ping 2.4s ease-out infinite;
}

.heat-caption {
  display: flex;
  justify-content: space-between;
  max-width: 420px;
  margin: 8px auto 0;
  padding-left: 31px;
  font-size: 0.7rem;
  color: var(--ink-subtle);
}

/* Stage gate */
.gate {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  counter-reset: gate;
}

.gate-step {
  position: relative;
  padding: 0 8px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.gate-step::before {
  content: "";
  position: absolute;
  top: 19px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--line);
  z-index: 0;
}

.gate-step:first-child::before {
  display: none;
}

.gate-step::after {
  content: "";
  position: absolute;
  top: 19px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ffca05, #faac18);
  transform: scaleX(0);
  transform-origin: left;
  animation: gate-line 8s ease infinite;
  animation-delay: var(--delay);
}

.gate-step:first-child::after {
  display: none;
}

.gate-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  font-weight: 800;
  background: var(--surface-muted);
  border: 2px solid var(--line);
  border-radius: 50%;
  animation: gate-dot 8s ease infinite;
  animation-delay: var(--delay);
}

.gate-step strong {
  display: block;
  color: var(--ink);
  font-size: 0.84rem;
}

/* Install mock */
.phone {
  position: relative;
  width: 210px;
  height: 400px;
  margin: 0 auto;
  padding: 14px;
  background: #16151a;
  border-radius: 36px;
  box-shadow: var(--shadow-lg);
}

.phone-screen {
  position: relative;
  height: 100%;
  padding: 34px 16px;
  background: linear-gradient(180deg, #2b2f4a, #4a3c62);
  border-radius: 26px;
  overflow: hidden;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 10px;
}

.app-grid span {
  aspect-ratio: 1;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.16);
}

.app-grid .new-app {
  background: none;
  animation: app-drop 5s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.app-grid .new-app img {
  width: 100%;
  height: 100%;
}

.phone-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 52px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- Glossary / FAQ ---------- */

.faq details {
  margin: 10px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow 0.2s;
}

.faq details[open] {
  box-shadow: var(--shadow-md);
}

.faq summary {
  position: relative;
  padding: 16px 48px 16px 18px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  font-size: 1.1rem;
  color: var(--ink-muted);
  background: var(--surface-muted);
  border-radius: 8px;
  transition: transform 0.3s;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details > div {
  padding: 0 18px 16px;
  color: var(--ink-muted);
}

.glossary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 1.2rem 0 2rem;
}

.glossary div {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.glossary dt {
  font-weight: 700;
  font-family: var(--font-display);
}

.glossary dd {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* ---------- Pager & footer ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4rem;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  color: var(--ink) !important;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none !important;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.pager a:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pager span {
  font-size: 0.76rem;
  color: var(--ink-subtle);
}

.pager strong {
  font-family: var(--font-display);
}

.pager .next {
  grid-column: 2;
  text-align: right;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3rem;
  padding-top: 24px;
  font-size: 0.84rem;
  color: var(--ink-subtle);
  border-top: 1px solid var(--line);
}

.site-footer img {
  width: 22px;
  height: 22px;
}

.site-footer .brand-mini {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Search dialog ---------- */

.search-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 80px));
  margin: 10vh auto auto;
  padding: 0;
  color: var(--ink);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: dialog-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.search-dialog::backdrop {
  background: rgba(12, 12, 16, 0.5);
  backdrop-filter: blur(4px);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.search-field svg {
  width: 20px;
  height: 20px;
  color: var(--ink-subtle);
  flex: none;
}

.search-field input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
}

.search-results li {
  margin: 0;
}

.search-results a {
  display: block;
  padding: 10px 12px;
  color: var(--ink) !important;
  border-radius: 10px;
  text-decoration: none !important;
}

.search-results a[aria-selected="true"],
.search-results a:hover {
  background: var(--brand-soft);
}

.search-results small {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-subtle);
}

.search-results mark {
  color: inherit;
  background: rgba(250, 172, 24, 0.35);
  border-radius: 3px;
}

.search-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-subtle);
  font-size: 0.9rem;
}

.search-footer {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  font-size: 0.74rem;
  color: var(--ink-subtle);
  border-top: 1px solid var(--line);
}

/* ---------- Reveal ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #ffca05, #faac18);
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Keyframes ---------- */

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes glow-drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-30px, 20px) scale(1.1);
  }
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

@keyframes typing {
  0%,
  8% {
    width: 0;
  }
  45%,
  85% {
    width: 9.5ch;
  }
  100% {
    width: 0;
  }
}

@keyframes caret {
  50% {
    border-color: transparent;
  }
}

@keyframes palette-hit {
  0%,
  45% {
    background: transparent;
  }
  50%,
  85% {
    background: var(--brand-soft);
  }
  100% {
    background: transparent;
  }
}

@keyframes bar-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes pop-in {
  from {
    transform: rotate(45deg) scale(0);
  }
  to {
    transform: rotate(45deg) scale(1);
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes notice-in {
  0% {
    opacity: 0;
    transform: translateX(30px) scale(0.97);
  }
  8%,
  80% {
    opacity: 1;
    transform: none;
  }
  90%,
  100% {
    opacity: 0;
    transform: translateX(-10px);
  }
}

@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
  }
  80%,
  100% {
    box-shadow: 0 0 0 9px rgba(22, 163, 74, 0);
  }
}

@keyframes gate-line {
  0%,
  10% {
    transform: scaleX(0);
  }
  25%,
  90% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(0);
  }
}

@keyframes gate-dot {
  0%,
  20% {
    background: var(--surface-muted);
    border-color: var(--line);
    color: var(--ink-muted);
  }
  28%,
  90% {
    background: linear-gradient(135deg, #ffca05, #faac18);
    border-color: transparent;
    color: #1a1204;
    transform: scale(1.06);
  }
  100% {
    background: var(--surface-muted);
    border-color: var(--line);
    transform: none;
  }
}

@keyframes app-drop {
  0%,
  10% {
    opacity: 0;
    transform: translateY(-40px) scale(0.6);
  }
  30%,
  85% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1240px) {
  .main {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 1000px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .menu-button {
    display: inline-grid;
  }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    z-index: 45;
    width: min(320px, 86vw);
    background: var(--bg);
    transform: translateX(-102%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }

  body.nav-open .sidebar {
    transform: none;
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 40;
    background: rgba(12, 12, 16, 0.4);
  }

  .search-trigger {
    min-width: 0;
  }

  .search-trigger .label,
  .search-trigger kbd {
    display: none;
  }

  .landing-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-stage {
    min-height: 380px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15.5px;
  }

  .brand-text span,
  .open-app .label {
    display: none;
  }

  .open-app {
    padding: 0 12px;
  }

  .main {
    padding-top: 24px;
  }

  .page-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 20px;
  }

  .page-hero .illustration {
    max-width: 200px;
    grid-row: 1;
  }

  .feature,
  .feature.reverse {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature.reverse > :first-child {
    order: 0;
  }

  .art-panel img {
    max-height: 210px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lifecycle {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .window-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .mini-sidebar {
    display: none;
  }

  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager .next {
    grid-column: 1;
  }

  .gantt {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .gantt-today {
    left: calc(84px + (100% - 84px) * 0.46);
  }

  td:first-child {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .notice {
    animation: none !important;
    opacity: 1 !important;
  }

  .palette-input .typed {
    width: 9.5ch;
    animation: none !important;
  }
}

@media print {
  .site-header,
  .sidebar,
  .toc,
  .pager,
  .progress-bar {
    display: none !important;
  }

  .layout,
  .main {
    display: block;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* Demos start animating only once they scroll into view. */
.js [data-reveal]:not(.is-visible) *,
.js [data-reveal]:not(.is-visible)::before,
.js [data-reveal]:not(.is-visible)::after {
  animation-play-state: paused;
}

.page-hero.no-art {
  grid-template-columns: minmax(0, 1fr);
}

code {
  padding: 0.1em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.84em;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.lifecycle.three {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.search-trigger svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.search-trigger .label {
  white-space: nowrap;
}

.card-grid.three {
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.brand-text .short {
  display: none;
}

@media (max-width: 480px) {
  .brand-text .long {
    display: none;
  }

  .brand-text .short {
    display: inline;
  }
}

.brand-text strong span {
  font-size: inherit;
  color: inherit;
}

/* ---------- Mobile TOC & back to top ---------- */

.mobile-toc {
  display: none;
  margin: -0.6rem 0 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mobile-toc summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  font-weight: 650;
  font-size: 0.92rem;
  cursor: pointer;
  list-style: none;
}

.mobile-toc summary::-webkit-details-marker {
  display: none;
}

.mobile-toc summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid var(--ink-subtle);
  border-bottom: 2px solid var(--ink-subtle);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.25s;
}

.mobile-toc[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.mobile-toc nav {
  display: grid;
  padding: 0 8px 8px;
  border-top: 1px solid var(--line);
}

.mobile-toc a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ink-muted) !important;
  font-size: 0.92rem;
  border-radius: 10px;
  text-decoration: none !important;
}

.mobile-toc a:active,
.mobile-toc a:hover {
  background: var(--surface-muted);
  color: var(--ink) !important;
}

.back-to-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  color: #1a1204;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #ffca05, #faac18);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 24px -8px var(--brand-glow), var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.back-to-top.is-shown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 1240px) {
  .mobile-toc {
    display: block;
  }
}

/* ---------- Phone & small tablet refinements ---------- */

@media (max-width: 1000px) {
  .site-header {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    gap: 8px;
  }

  .nav-link {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 0.96rem;
  }

  .sidebar {
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 760px) {
  .landing-hero {
    padding-top: 28px;
    gap: 28px;
  }

  .landing-hero h1 {
    font-size: clamp(2.1rem, 10vw, 2.7rem);
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .button {
    justify-content: center;
    width: 100%;
  }

  .hero-stage {
    min-height: 0;
  }

  .hero-stage .illustration {
    display: none;
  }

  .stats {
    gap: 10px;
    margin-top: 28px;
  }

  .stat {
    padding: 14px;
  }

  .stat strong {
    font-size: 1.6rem;
  }

  .stat span {
    display: block;
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .section-head {
    margin-top: 3.2rem;
  }

  .card-grid,
  .card-grid.two,
  .card-grid.three,
  .card-grid.four {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .card {
    padding: 16px;
  }

  .card:has(> .card-icon) {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 2px;
    align-items: start;
  }

  .card:has(> .card-icon) > .card-icon {
    grid-row: span 3;
  }

  .card:has(> .card-icon) h3 {
    margin-top: 0;
  }

  a.card {
    padding-right: 40px;
  }

  a.card::after {
    top: 50%;
    right: 16px;
    margin-top: -0.8em;
  }

  .card.with-art {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: stretch;
    padding: 0 40px 0 0;
  }

  .card.with-art .art {
    height: auto;
    min-height: 112px;
  }

  .card.with-art .art img {
    height: 96px;
  }

  .card.with-art .body {
    justify-content: center;
    padding: 14px 0 14px 16px;
  }

  .card.with-art .body p {
    font-size: 0.86rem;
  }

  .page-hero {
    gap: 8px;
    margin-bottom: 1.6rem;
    border-radius: 18px;
  }

  .page-hero .illustration {
    max-width: 180px;
  }

  .lede {
    font-size: 1.03rem;
  }

  h2 {
    margin-top: 2.6rem;
  }

  .steps > li {
    padding-left: 48px;
  }

  .callout {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 14px 16px;
  }

  .art-panel {
    padding: 14px;
  }

  .phone {
    width: 170px;
    height: 320px;
    padding: 11px;
    border-radius: 30px;
  }

  .phone-screen {
    padding: 26px 12px;
    border-radius: 22px;
  }

  .app-grid {
    gap: 11px 8px;
  }

  .window {
    border-radius: 14px;
  }

  .window-bar .address {
    font-size: 0.64rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .window-content {
    padding: 10px;
  }

  .kanban {
    gap: 6px;
  }

  .kanban-col {
    min-height: 0;
    padding: 6px;
  }

  .kanban-col h4 {
    font-size: 0.6rem;
  }

  .task {
    padding: 6px 7px;
    font-size: 0.64rem;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    left: 10px;
    justify-content: center;
  }

  .kpi {
    padding: 10px;
  }

  .kpi strong {
    font-size: 1rem;
  }

  .gantt-label {
    font-size: 0.64rem;
    line-height: 1.2;
    white-space: normal;
  }

  .window-body {
    min-height: 0;
  }

  .gate-step {
    padding: 0 2px;
    font-size: 0.68rem;
    line-height: 1.35;
  }

  .gate-step strong {
    font-size: 0.74rem;
  }

  .gate-dot {
    width: 34px;
    height: 34px;
  }

  .gate-step::before,
  .gate-step::after {
    top: 16px;
  }

  .faq summary {
    min-height: 52px;
    padding: 14px 48px 14px 16px;
  }

  .glossary {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px);
    margin: 12px auto auto;
  }

  .search-footer {
    display: none;
  }

  /* Tables with three or more columns become stacked cards. */
  table.stack thead {
    display: none;
  }

  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack td {
    display: block;
    width: 100%;
  }

  table.stack tr {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }

  table.stack tr:last-child {
    border-bottom: 0;
  }

  table.stack td {
    padding: 3px 0;
    border: 0;
  }

  table.stack td:first-child {
    padding-bottom: 6px;
    font-family: var(--font-display);
    font-size: 1rem;
  }

  table.stack td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-subtle);
  }

  table:not(.stack) th,
  table:not(.stack) td {
    padding: 11px 12px;
  }
}

@media (max-width: 380px) {
  .stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpis {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .card.with-art {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .card.with-art .art img {
    height: 80px;
  }

  .theme-toggle {
    width: 36px;
  }
}

.status-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.92rem;
}

.status-list i {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--c, var(--ink-subtle));
}


/* ---------- Board demo (moved by site.js) ---------- */

.kanban-col h4 {
  height: 18px;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
}

.kanban .task {
  position: relative;
  transition: border-color 0.4s, box-shadow 0.4s;
}

.kanban .task.is-lifted {
  z-index: 3;
  box-shadow: var(--shadow-lg);
}

.kanban .task.is-done {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
}

.kanban .task.is-done b::after {
  content: " ✓";
  color: var(--green);
}

.hero-stage .toast {
  top: -18px;
  right: 18px;
  bottom: auto;
  left: auto;
  z-index: 5;
}

/* ---------- Wide screens ---------- */

.main {
  justify-self: center;
  width: 100%;
}

.hero-stage {
  min-height: 0;
  padding: 0 0 56px 0;
}

.hero-stage .illustration {
  width: 150px;
  left: -36px;
  right: auto;
  bottom: -10px;
}

@media (min-width: 1360px) {
  .landing-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 56px;
  }
}

@media (min-width: 1001px) and (max-width: 1359px) {
  .landing-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .landing-hero h1 {
    max-width: 14ch;
  }

  .hero-stage {
    max-width: 720px;
    margin-left: 36px;
  }
}

@media (max-width: 1000px) {
  .hero-stage {
    margin-left: 0;
  }

  .hero-stage .illustration {
    width: 120px;
    left: -8px;
  }
}

.card-grid.four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 1280px) {
  .card-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .card-grid.four {
    grid-template-columns: minmax(0, 1fr);
  }
}
