/* Portal chrome + docs - light Stripe-inspired layout */

body.layout-docs {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.layout-docs main.docs-main {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
  width: 100%;
  animation: fadeUp 0.4s ease-out both;
}

body.layout-home main.home-main {
  flex: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3.5rem;
  width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.site-logo {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  margin-right: 0.75rem;
}

.site-logo:hover { color: var(--accent); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 1.35rem;
  flex: 1;
  min-width: 0;
}

.site-header-end {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
  flex-shrink: 0;
}

.site-account {
  position: relative;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--text);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.nav-dropdown-trigger:hover {
  color: var(--text);
}

.nav-dropdown-caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
}

.nav-dropdown.is-active .nav-dropdown-trigger,
.nav-dropdown.is-open .nav-dropdown-trigger {
  color: var(--text);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  min-width: 14rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 30, 50, 0.08);
  z-index: 40;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
}

.nav-dropdown-item:hover,
.nav-dropdown-item[aria-current="page"] {
  background: #f4f6f9;
}

.nav-dropdown-title {
  white-space: nowrap;
}

.nav-dropdown-all {
  margin-top: 0.2rem;
  border-top: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  color: var(--muted);
  font-weight: 600;
}

.nav-account-signin {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-account-signin:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  max-width: 11rem;
}

.nav-account-trigger:hover,
.nav-account.is-open .nav-account-trigger {
  border-color: var(--accent);
}

.nav-account-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-account-menu {
  left: auto;
  right: 0;
  min-width: 13.5rem;
}

.nav-account-identity {
  padding: 0.45rem 0.55rem 0.55rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-account-action {
  width: 100%;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.nav-account-signout {
  margin-top: 0.15rem;
  border-top: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  color: var(--muted);
}

.staging-pill {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; order: 2; margin-left: auto; }
  .site-header-end { order: 3; margin-left: 0; }
  .site-nav {
    display: none;
    order: 4;
    width: 100%;
    flex: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.5rem 0 0.75rem;
  }
  .site-nav.open { display: flex; }
  .nav-account-trigger { max-width: 8.5rem; }
  .staging-pill { display: none; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0.15rem 0 0.15rem 0.75rem;
    min-width: 0;
    background: transparent;
  }
  .nav-dropdown-menu[hidden] { display: none !important; }
  .nav-dropdown.is-open .nav-dropdown-menu { display: flex; flex-direction: column; gap: 0.15rem; }
  /* Account menu stays anchored top-right, not inside the hamburger list */
  .nav-account {
    width: auto;
  }
  .nav-account .nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    left: auto;
    width: max-content;
    min-width: 13.5rem;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(20, 30, 50, 0.08);
  }
  .nav-account .nav-dropdown-menu[hidden] { display: none !important; }
  .nav-account.is-open .nav-dropdown-menu { display: block; }
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
  background: #fff;
}

.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer code {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--text);
  background: #eef2f7;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.footer-meta { margin: 0.35rem 0 0; }

/* Home */
.home-hero {
  padding: 1.5rem 0 1.25rem;
}

.home-hero .brand {
  margin-bottom: 0.55rem;
  font-size: clamp(1.55rem, 3.5vw, 1.85rem);
  font-weight: 500;
}

.home-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 1.95rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 0.65rem;
  max-width: 22ch;
}

.home-hero .lead {
  max-width: 46ch;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 1.1rem;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text) !important;
  border: 1px solid var(--border-hover);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--text);
  background: #f8fafc;
  color: var(--text) !important;
  text-decoration: none;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-top: 2.5rem;
}

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

.path-card {
  display: block;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.path-card:hover {
  border-color: var(--border-hover);
  background: #fbfcfe;
  box-shadow: none;
  transform: none;
}

.path-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.path-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.path-grid-docs {
  margin-top: 0.75rem;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.status-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #f4f6f9;
  color: var(--muted);
  vertical-align: middle;
}

.status-pill.status-poc {
  background: #f7f1e8;
  border-color: #e0d2bc;
  color: #6b5428;
}

.status-pill.status-preview {
  background: #eef3f9;
  border-color: #c5d4e8;
  color: #2c4a6e;
}

.status-pill.status-live {
  background: #e8f3ec;
  border-color: #b7d4c0;
  color: #1e5c35;
}

.status-pill.status-mcp {
  background: #f0f0f4;
  border-color: #d0d0da;
  color: #444;
}

.docs-main .crumb {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.docs-main .crumb a {
  color: var(--link);
  text-decoration: none;
}

.docs-main .crumb a:hover {
  text-decoration: underline;
}

.home-section-label {
  margin: 2.25rem 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-section-label a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}

.home-section-label a:hover {
  color: var(--link);
}

/* Docs */
.docs-main h1 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.6vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
}

.docs-main .lead {
  max-width: 52ch;
  margin-bottom: 1.85rem;
  font-size: 0.95rem;
  line-height: 1.55;
}

.docs-main section {
  margin-bottom: 2.15rem;
  padding-top: 0.15rem;
}

.docs-main h2 {
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.65rem;
  padding-top: 0.1rem;
}

.docs-main h3 {
  font-size: 0.9rem;
  margin: 1.1rem 0 0.45rem;
  font-weight: 600;
}

.docs-main p,
.docs-main li {
  color: var(--muted);
  font-size: 0.9rem;
}

.docs-main strong { color: var(--text); }

.docs-main ol,
.docs-main ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 1rem;
}

.docs-main li { margin: 0.4rem 0; }

.docs-main a { color: var(--accent); text-decoration: none; }
.docs-main a:hover { text-decoration: underline; }

/* Docs link color must not wash out CTA buttons (a.btn-* loses to .docs-main a otherwise). */
.docs-main a.btn-primary,
.home-main a.btn-primary {
  color: #fff !important;
  text-decoration: none;
}
.docs-main a.btn-primary:hover,
.docs-main a.btn-primary:active,
.home-main a.btn-primary:hover,
.home-main a.btn-primary:active {
  color: #fff !important;
  text-decoration: none;
}
.docs-main a.btn-secondary,
.home-main a.btn-secondary {
  color: var(--text) !important;
  text-decoration: none;
}
.docs-main a.btn-secondary:hover,
.home-main a.btn-secondary:hover {
  color: var(--text) !important;
  text-decoration: none;
}

.code-block {
  position: relative;
  margin: 0.85rem 0 1.35rem;
}

.code-block pre {
  margin: 0;
  padding: 0.95rem 1rem;
  padding-right: 4.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  background: var(--code-bg);
  border: none;
  border-radius: 10px;
  overflow-x: auto;
  color: var(--code-text);
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow-sm);
}

.code-block .btn-copy {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.code-block .btn-copy:hover {
  background: rgba(255, 255, 255, 0.16);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0.75rem 0 1.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.docs-table tr:last-child td { border-bottom: none; }

.docs-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f8fafc;
}

.docs-table td { color: var(--text); }
.docs-table code {
  font-family: var(--mono);
  font-size: 0.8em;
  color: #3f38c7;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.note {
  padding: 0.9rem 1.05rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 1rem 0;
}

.note.warn-note {
  border-left-color: var(--warn);
  background: rgba(196, 92, 0, 0.07);
}

.inline-cta {
  display: inline-flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

body.layout-keys main {
  max-width: 560px;
}

body.layout-keys .site-header-inner {
  max-width: 1080px;
}

.next-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.next-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.next-links a:hover { text-decoration: underline; }

/* Copy-for-your-LLM blocks */
.agent-setup {
  margin: 0 0 2.15rem;
  padding: 1rem 1.1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
}

.agent-setup h2 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}

.agent-setup > .agent-intro {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.agent-setup .agent-note {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.agent-setup .code-block {
  margin: 0;
}

.agent-setup .code-block pre.agent-prompt {
  max-height: 20rem;
  overflow-y: auto;
  font-size: 0.72rem;
  line-height: 1.45;
}
