@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap');

/* ── Anthropic-inspired palette ── */
:root {
  --crucis-bg: #f5f4ed;
  --crucis-surface: #faf9f5;
  --crucis-border: #e8e6e3;
  --crucis-text: #2c2c2c;
  --crucis-text-soft: #6a6158;
  --crucis-link: #c15f3c;
  --crucis-link-hover: #a14a2f;
  --crucis-code-bg: #1a1815;
  --crucis-code-fg: #e8e6e3;
}

[data-md-color-scheme="default"] {
  --md-default-bg-color: var(--crucis-surface);
  --md-default-fg-color: var(--crucis-text);
  --md-default-fg-color--light: var(--crucis-text-soft);
  --md-primary-fg-color: var(--crucis-surface);
  --md-primary-bg-color: var(--crucis-text);
  --md-accent-fg-color: var(--crucis-link);
  --md-typeset-a-color: var(--crucis-link);
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #1a1815;
  --md-default-fg-color: #e8e6e3;
  --md-default-fg-color--light: #9a9389;
  --md-primary-fg-color: #201d18;
  --md-primary-bg-color: #e8e6e3;
  --md-accent-fg-color: #d97757;
  --md-typeset-a-color: #d97757;
  --crucis-bg: #201d18;
  --crucis-surface: #1a1815;
  --crucis-border: #3a352b;
  --crucis-text: #e8e6e3;
  --crucis-text-soft: #9a9389;
  --crucis-link: #d97757;
  --crucis-link-hover: #e8916e;
  --crucis-code-bg: #252118;
  --crucis-code-fg: #e8e6e3;
}

/* Swap logo in dark mode */
[data-md-color-scheme="slate"] .md-header__button.md-logo img {
  content: url("../images/crucis-logo-dark.svg");
  /* Fallback for Firefox */
  visibility: hidden;
  width: 2.4rem;
  height: 2.4rem;
  background: url("../images/crucis-logo-dark.svg") no-repeat center / contain;
}

/* Chrome/Safari: content works, restore visibility */
@supports (content: url("")) {
  [data-md-color-scheme="slate"] .md-header__button.md-logo img {
    visibility: visible;
    background: none;
  }
}

body,
input,
button {
  font-family: "Inter", sans-serif;
  font-size: 14px;
}

.md-header {
  background: var(--crucis-surface);
  color: var(--crucis-text);
  border-bottom: 1px solid var(--crucis-border);
  box-shadow: none;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.md-header__inner {
  max-width: none;
  padding-left: 0.5rem;
  display: flex;
  align-items: center;
}

.md-search {
  margin: 0 auto;
}

/* Place dark/light toggle after the GitHub source link */
.md-header__source {
  order: 10;
}

.md-header__option {
  order: 11;
  margin-left: 0.25rem;
  margin-right: 0.5rem;
}



.md-header__button.md-logo {
  display: inline-flex;
  align-items: center;
  margin-right: 0.3rem;
  position: absolute;
  left: 0.75rem;
}

.md-header__title {
  position: absolute;
  left: 3.5rem;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 2.4rem;
  width: 2.4rem;
}

.md-header__topic:first-child {
  font-weight: 700;
  font-size: 1rem;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.02em;
}

/* Hide the page title in header (second topic) */
.md-header__topic:last-child {
  display: none;
}

/* Tabs: merge into header visually */
.md-tabs {
  background: var(--crucis-surface);
  border-bottom: 1px solid var(--crucis-border);
  position: static;
}

.md-tabs__list {
  padding-left: 0;
}

.md-tabs__item {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.md-tabs__link {
  color: var(--crucis-text-soft);
  opacity: 1;
}

.md-tabs__link--active,
.md-tabs__link:hover {
  color: var(--crucis-link);
}


.md-main {
  background: var(--crucis-surface);
}

.md-main__inner {
  max-width: 1650px;
}

.md-sidebar--primary .md-sidebar__scrollwrap {
  background: var(--crucis-bg);
  border-right: 1px solid var(--crucis-border);
}

.md-nav__title {
  color: var(--crucis-text-soft);
  font-weight: 600;
}

.md-nav__item .md-nav__link {
  color: #6a6158;
}

.md-nav__item .md-nav__link:hover,
.md-nav__item .md-nav__link--active {
  color: var(--crucis-link);
}

.md-sidebar--secondary .md-sidebar__scrollwrap {
  border-left: 1px solid var(--crucis-border);
  padding-left: 0.6rem;
}

.md-nav--secondary .md-nav__title {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.md-content {
  max-width: 860px;
}

.md-content__inner > h1:first-of-type {
  margin-top: 0.2rem;
}

.hero-logo {
  max-width: 460px;
  width: 100%;
  height: auto;
  margin: 0.15rem 0 1rem;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-family: "Space Grotesk", sans-serif;
}

.md-typeset h1 {
  font-size: 2.05rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.md-typeset h2 {
  margin-top: 2rem;
  font-size: 1.45rem;
  font-weight: 600;
}

.md-typeset h3 {
  font-weight: 600;
}

.md-typeset p,
.md-typeset li {
  color: var(--crucis-text-soft);
}

.md-typeset a:hover {
  color: var(--crucis-link-hover);
}

.md-typeset code {
  background: #f0efed;
  border: 1px solid #e8e6e3;
  color: #a14a2f;
  border-radius: 6px;
  padding: 0.13em 0.32em;
}

.md-typeset pre > code {
  background: var(--crucis-code-bg);
  border: 0;
  color: var(--crucis-code-fg);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
}

.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px;
  border: 1px solid var(--crucis-border);
  box-shadow: none;
}

.md-typeset .admonition-title,
.md-typeset summary {
  font-weight: 600;
}

.md-typeset table:not([class]) {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--crucis-border);
}

.md-typeset table:not([class]) th {
  background: #f0efed;
  color: #2c2c2c;
}

.md-search__form {
  border: 1px solid var(--crucis-border);
  border-radius: 8px;
  background: #f5f4ed;
}

.md-footer {
  background: var(--crucis-surface);
  border-top: 1px solid var(--crucis-border);
  color: var(--crucis-text-soft);
}

.md-footer-meta {
  background: transparent;
}

.md-footer-meta .md-copyright {
  color: var(--crucis-text-soft);
}

.md-footer-meta .md-copyright {
  display: none;
}

/* Dark mode overrides for hardcoded colors */
[data-md-color-scheme="slate"] .md-nav__item .md-nav__link {
  color: #9a9389;
}

[data-md-color-scheme="slate"] .md-typeset code {
  background: #252118;
  border-color: #3a352b;
  color: #d97757;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background: #252118;
  color: #e8e6e3;
}

[data-md-color-scheme="slate"] .md-search__form {
  background: #252118;
  border-color: #3a352b;
}

[data-md-color-scheme="slate"] .md-sidebar--primary .md-sidebar__scrollwrap {
  background: #201d18;
}
