/* MEGALab terminal theme — layered on mkdocs-material (slate scheme) */

:root {
  --ml-bg: #07090a;
  --ml-surface: #0e1214;
  --ml-line: #1f2a2e;
  --ml-text: #e8ece9;
  --ml-muted: #7d8a86;
  --ml-green: #3dff8b;
  --ml-red: #ff3d3d;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: var(--ml-bg);
  --md-default-fg-color: var(--ml-text);
  --md-default-fg-color--light: var(--ml-muted);
  --md-primary-fg-color: var(--ml-bg);
  --md-primary-bg-color: var(--ml-text);
  --md-accent-fg-color: var(--ml-green);
  --md-typeset-color: var(--ml-text);
  --md-typeset-a-color: var(--ml-green);
  --md-code-bg-color: var(--ml-surface);
  --md-footer-bg-color: var(--ml-bg);
  --md-footer-bg-color--dark: var(--ml-bg);
}

body { background: var(--ml-bg); }

/* ---------- chrome ---------- */
.md-header {
  background: rgba(7, 9, 10, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ml-line);
  box-shadow: none;
}
/* single bar: brand | tabs | search */
.md-header__title { flex: 0 0 auto; margin-right: 1.2rem; }
/* no book icon in the mobile drawer either */
.md-nav__title .md-logo { display: none; }
.md-header__ellipsis { position: static; }
.md-header__topic { position: static; }
.ml-brand { color: inherit; }
.ml-brand:hover { color: var(--ml-green); }
@media screen and (max-width: 76.234375em) {
  .md-header__title { flex: 1 1 auto; }
}
.md-header .md-tabs {
  flex: 1;
  width: auto;
  background: none;
  border: 0;
  overflow: visible;
}
.md-header .md-tabs > .md-grid { max-width: none; margin: 0; padding: 0; }
.md-header .md-tabs__list { margin: 0; white-space: nowrap; }
.md-header .md-tabs__item { height: 2.4rem; padding: 0 .55rem; }
.md-header .md-tabs__link { margin-top: 0; line-height: 2.4rem; }
.md-header__topic:first-child { font-weight: 800; letter-spacing: .02em; }
.md-header__topic:first-child::before { content: "~/"; color: var(--ml-green); }
/* the brand is the home link, so drop the duplicate ~/ tab */
.md-header .md-tabs__item:first-child { display: none; }
.md-tabs__link { opacity: .65; font-size: .72rem; }
.md-tabs__link--active, .md-tabs__link:hover { opacity: 1; color: var(--ml-green); }
.md-footer { border-top: 1px solid var(--ml-line); }
/* let the copyright wrap on phones instead of clipping */
.md-copyright, .md-copyright__highlight { white-space: normal; overflow: visible; }

/* ---------- content pages ---------- */
.md-typeset { font-size: .82rem; line-height: 1.7; }
.md-typeset h1 {
  color: var(--ml-text);
  font-weight: 800;
  font-size: 2.2em;
  letter-spacing: -.02em;
  margin-bottom: .4em;
}
.md-typeset h1::before { content: "$ "; color: var(--ml-green); }
.md-typeset h2 { font-weight: 700; color: var(--ml-text); }
.md-typeset h2::before { content: "# "; color: var(--ml-red); }
.md-typeset h3 { font-weight: 700; color: var(--ml-green); }
.md-typeset strong { color: #fff; }
.md-typeset blockquote {
  border-left: 3px solid var(--ml-green);
  color: var(--ml-text);
  font-size: 1.15em;
  font-weight: 700;
}
.md-typeset .lead { font-size: 1.25em; color: var(--ml-muted); margin-top: 0; }
.md-typeset .boom { color: var(--ml-red); font-weight: 800; }

.md-typeset .md-button {
  border: 1px solid var(--ml-green);
  color: var(--ml-green);
  border-radius: 0;
  font-weight: 700;
  margin: 0 .4rem .5rem 0;
}
.md-typeset .md-button--primary {
  background: var(--ml-green);
  color: var(--ml-bg);
}
.md-typeset .md-button.amazon-buy {
  background: #ffd814;
  border: 1px solid #fcd200;
  border-radius: 100px;
  color: #0f1111;
  font-family: "Amazon Ember", Arial, sans-serif;
  font-weight: 700;
}
.md-typeset .md-button.amazon-buy:hover { background: #f7ca00; border-color: #f2c200; color: #0f1111; }
.md-typeset .md-button:not(.amazon-buy):hover { background: var(--ml-green); color: var(--ml-bg); border-color: var(--ml-green); }

.md-typeset .grid.cards > ul > li,
.md-typeset .grid > .card {
  border: 1px solid var(--ml-line);
  border-radius: 0;
  background: var(--ml-surface);
}
.md-typeset .grid.cards > ul > li:hover { border-color: var(--ml-green); box-shadow: none; }

/* ---------- home ---------- */
.ml-wrap, .ml-hero__inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.ml-hero {
  padding: 4rem 0 3rem;
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(61, 255, 139, .12), transparent 60%),
    linear-gradient(transparent 95%, rgba(61, 255, 139, .04) 95%) 0 0 / 100% 24px;
  border-bottom: 1px solid var(--ml-line);
}

.ml-term {
  max-width: 620px;
  margin-top: 3rem;
  background: var(--ml-surface);
  border: 1px solid var(--ml-line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  font-size: .8rem;
}
.ml-term__bar { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--ml-line); }
.ml-term__bar span { width: 10px; height: 10px; border-radius: 50%; background: #2a3336; }
.ml-term__bar span:first-child { background: var(--ml-red); }
.ml-term__bar em { margin-left: auto; font-style: normal; color: var(--ml-muted); font-size: .7rem; }
.ml-term__body { padding: 14px 16px 18px; overflow-x: auto; }
.ml-line { margin: 0 0 4px; color: var(--ml-text); white-space: nowrap; overflow: hidden;
  opacity: 0; animation: ml-in .35s steps(12) forwards; animation-delay: calc(var(--d) * .55s); }
.ml-line b { color: var(--ml-green); }
.ml-out { color: var(--ml-muted); }
.ml-boom { color: var(--ml-red); font-weight: 800; font-size: 1.6em; margin-top: 6px; }
.ml-cursor { display: inline-block; width: .55em; height: 1em; margin-left: 4px; vertical-align: -2px;
  background: var(--ml-green); animation: ml-blink 1s steps(1) infinite; }

@keyframes ml-in { from { opacity: 0; max-width: 0; } to { opacity: 1; max-width: 100%; } }
@keyframes ml-blink { 50% { opacity: 0; } }

.ml-hero__title {
  margin: 0 0 .5rem;
  font-size: clamp(1.8rem, 8vw, 4.6rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--ml-text);
}
.ml-hero__title span { color: var(--ml-green); }
.ml-hero__sub { font-size: clamp(1.05rem, 2.6vw, 1.5rem); color: var(--ml-text); margin: 0 0 .5rem; max-width: 40ch; line-height: 1.4; }
.ml-hero__sub b { color: var(--ml-green); }
.ml-hero__sub em { font-style: normal; font-weight: 800; color: #fff; border-bottom: 3px solid var(--ml-red); }
.ml-hero__kicker { color: var(--ml-muted); font-size: clamp(.85rem, 1.8vw, 1rem); margin: 0 0 2rem; max-width: 52ch; }

.ml-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.ml-btn {
  display: inline-block;
  padding: .8rem 1.4rem;
  border: 1px solid var(--ml-line);
  color: var(--ml-text) !important;
  font-weight: 700;
  font-size: .85rem;
  transition: border-color .15s, background .15s, color .15s;
}
.ml-btn:hover { border-color: var(--ml-green); color: var(--ml-green) !important; }
.ml-btn--go { background: var(--ml-green); border-color: var(--ml-green); color: var(--ml-bg) !important; }
.ml-btn--go:hover { background: transparent; }

.ml-section { padding: 4rem 0; border-bottom: 1px solid var(--ml-line); }
.ml-h2 { font-size: 1rem; font-weight: 700; color: var(--ml-muted); text-transform: lowercase; margin: 0 0 1.6rem; }
.ml-h2 b { color: var(--ml-red); }

.ml-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--ml-line); border: 1px solid var(--ml-line); }
.ml-step { background: var(--ml-bg); padding: 1.8rem 1.5rem; display: flex; flex-direction: column; }
.ml-step code, .ml-card code { color: var(--ml-green); background: none; font-size: .72rem; padding: 0; }
.ml-step h3, .ml-card h3 { margin: .6rem 0 .4rem; color: var(--ml-text); font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.ml-step p, .ml-card p { margin: 0; color: var(--ml-muted); font-size: .8rem; line-height: 1.6; }

.ml-step__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 1rem; }
.ml-step__tags span { padding: .25rem .6rem; border: 1px solid var(--ml-green); color: var(--ml-green); font-size: .72rem; font-weight: 700; }

.ml-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.ml-card {
  display: block;
  padding: 1.3rem 1.2rem;
  background: var(--ml-surface);
  border: 1px solid var(--ml-line);
  transition: border-color .15s, transform .15s;
}
.ml-card:hover { border-color: var(--ml-green); transform: translateY(-2px); }
.ml-card h3 { font-size: 1.05rem; }
.ml-card--feature {
  grid-column: 1 / -1;
  padding: 2rem 1.8rem;
  border-color: var(--ml-green);
  background: linear-gradient(120deg, rgba(61, 255, 139, .10), var(--ml-surface) 55%);
}
.ml-card--feature h3 { font-size: clamp(1.4rem, 3.5vw, 2.2rem); }
.ml-card--feature p { max-width: 60ch; font-size: .85rem; color: var(--ml-text); }
.ml-card__go { display: inline-block; margin-top: 1rem; color: var(--ml-green); font-weight: 700; font-size: .8rem; }

.ml-factories { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1.6rem; }
.ml-factories .ml-card h3 { font-size: clamp(1.15rem, 2.4vw, 1.5rem); }
.ml-nv { display: inline-block; vertical-align: middle; margin-left: .3rem; padding: .1rem .45rem; border: 1px solid #76b900; color: #76b900; font-size: .62rem; font-weight: 700; letter-spacing: .02em; }

.ml-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ml-tags span, .ml-tags a {
  padding: .4rem .75rem;
  border: 1px solid var(--ml-line);
  color: var(--ml-text);
  font-size: .78rem;
}
.ml-tags a { color: var(--ml-green); border-color: var(--ml-green); }

.ml-final { text-align: left; border-bottom: 0; }
.ml-final__kicker { color: var(--ml-muted); margin: 0 0 .5rem; font-size: .85rem; }
.ml-final__title { font-size: clamp(2rem, 6vw, 3.8rem); line-height: 1.05; font-weight: 800; letter-spacing: -.04em; color: var(--ml-text); margin: 0 0 2rem; }

/* home: no markdown body, so drop the empty main grid padding */
.md-main__inner:not(:has(.md-content)) { display: none; }

@media (max-width: 960px) {
  .ml-grid { grid-template-columns: repeat(2, 1fr); }
  .ml-steps { grid-template-columns: 1fr; }
  .ml-factories { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .ml-hero { padding-top: 2rem; }
  .ml-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ml-card { padding: 1rem .9rem; }
  .ml-card h3 { font-size: .95rem; }
  .ml-card p { font-size: .72rem; }
  .ml-card--feature { padding: 1.4rem 1.1rem; }
  .ml-term { font-size: .62rem; }
  .ml-term__body .ml-line { white-space: normal; padding-left: 1.2em; text-indent: -1.2em; }
  .ml-term__bar em { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ml-line { animation: none; opacity: 1; }
  .ml-cursor { animation: none; }
}

/* tables: terminal-style, readable */
.md-typeset table:not([class]) { font-size: .78rem; border: 1px solid var(--ml-line); border-radius: 0; background: var(--ml-surface); }
.md-typeset table:not([class]) th { color: var(--ml-muted); text-transform: lowercase; }
.md-typeset table:not([class]) td:first-child code { white-space: nowrap; color: var(--ml-green); background: none; }

/* project screenshots/photos */
.md-typeset img.ml-shot {
  display: block;
  max-width: 100%;
  max-height: 440px;
  margin: 1.4rem 0;
  border: 1px solid var(--ml-line);
}

/* partner logos: on a light card so dark brand colours stay legible */
.md-typeset img.ml-logo {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 1.4rem 0;
  padding: 1.4rem 1.8rem;
  background: #fff;
  border: 1px solid var(--ml-line);
}
