/* ---------------------------------------------------------------------------
   The Missing Skills — landing page and shared polish.

   Note on units: Material sets the root font size to 125%, so 1rem = 20px
   here. Values below are deliberately small for that reason.

   Note on weights: the theme only loads 300, 400 and 700 of the body font, so
   anything else would be synthesised by the browser. Stick to those three.
   --------------------------------------------------------------------------- */

:root {
  --ms-radius: 0.6rem;
  --ms-radius-sm: 0.4rem;
  --ms-hero-ink: #f2fbfa;
}

/* --- Hero ---------------------------------------------------------------- */

/* Two columns: the pitch on the left, a mock terminal on the right. The panel
   is dark in both colour schemes, so nothing here needs a slate variant. */
.ms-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 1.6rem;
  align-items: center;
  margin: 0 0 1.6rem;
  padding: 2.4rem 1.8rem;
  border-radius: 1rem;
  color: var(--ms-hero-ink);
  background:
    radial-gradient(125% 135% at 15% -25%,
      #19bfae 0%, #0f8f83 32%, #0c5b56 62%, #07302f 100%);
}

/* Dot grid, faded out towards the bottom. */
.ms-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 0.9rem 0.9rem;
  -webkit-mask-image: radial-gradient(85% 90% at 25% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(85% 90% at 25% 0%, #000 0%, transparent 78%);
}

.md-typeset .ms-hero__text > :first-child {
  margin-top: 0;
}

.md-typeset .ms-hero__text > :last-child {
  margin-bottom: 0;
}

/* Markdown wraps the badge in a paragraph of its own. */
.md-typeset .ms-hero__text > p:first-child {
  margin-bottom: 0.55rem;
}

.md-typeset .ms-hero .headerlink {
  color: rgba(255, 255, 255, 0.4);
}

.md-typeset .ms-hero .headerlink:hover {
  color: #fff;
}

.ms-hero__badge {
  display: inline-block;
  padding: 0.18rem 0.65rem;
  border: 0.05rem solid rgba(255, 255, 255, 0.28);
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

.md-typeset .ms-hero h1 {
  margin: 0 0 0.6rem;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.md-typeset .ms-hero .ms-hero__tagline {
  max-width: 22rem;
  margin: 0 0 1.15rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
}

.md-typeset .ms-hero .md-button {
  margin: 0.25rem 0.3rem 0 0;
  border-radius: 2rem;
  border-width: 0.05rem;
  padding: 0.55em 1.6em;
  font-size: 0.75rem;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.md-typeset .ms-hero .md-button:focus,
.md-typeset .ms-hero .md-button:hover {
  background-color: rgba(255, 255, 255, 0.14);
  border-color: #fff;
  color: #fff;
}

.md-typeset .ms-hero .md-button--primary {
  background-color: #fff;
  border-color: #fff;
  color: #0a4a46;
}

.md-typeset .ms-hero .md-button--primary:focus,
.md-typeset .ms-hero .md-button--primary:hover {
  background-color: #d8fbf6;
  border-color: #d8fbf6;
  color: #06302e;
}

/* --- Hero terminal ------------------------------------------------------- */

/* Decorative only: the markup carries aria-hidden, so it is skipped by screen
   readers and nothing here is load-bearing for meaning. */
.ms-term {
  overflow: hidden;
  border: 0.05rem solid rgba(255, 255, 255, 0.16);
  border-radius: 0.55rem;
  background: rgba(3, 24, 23, 0.66);
  box-shadow: 0 0.55rem 1.5rem rgba(0, 0, 0, 0.32);
  font-family: var(--md-code-font-family, monospace);
  font-size: 0.6rem;
  line-height: 1.8;
}

.ms-term__bar {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 0.05rem solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.07);
}

.ms-term__dot {
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.ms-term__dot:nth-child(1) { background: #ff5f57; }
.ms-term__dot:nth-child(2) { background: #febc2e; }
.ms-term__dot:nth-child(3) { background: #28c840; }

.ms-term__name {
  margin-left: auto;
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.45);
}

.ms-term__body {
  overflow: hidden;
  padding: 0.6rem 0.7rem 0.7rem;
  white-space: nowrap;
}

.ms-term__line {
  color: rgba(255, 255, 255, 0.9);
}

.ms-term__prompt {
  margin-right: 0.25em;
  color: #4fd6c3;
}

.ms-term__out {
  padding-left: 0.9em;
  color: rgba(255, 255, 255, 0.45);
}

.ms-term__ok {
  padding-left: 0.9em;
  color: #6ee7b7;
}

.ms-term__ok::before {
  content: "\2713";
  margin-right: 0.4em;
}

.ms-term__caret {
  display: inline-block;
  width: 0.42em;
  height: 0.95em;
  margin-left: 0.3em;
  vertical-align: -0.12em;
  background: #6ee7b7;
  animation: ms-blink 1.15s steps(1) infinite;
}

@keyframes ms-blink {
  50% { opacity: 0; }
}

/* --- Counters strip ------------------------------------------------------ */

.md-typeset .ms-stats > ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0 0 2.4rem;
  padding: 0;
  list-style: none;
}

.md-typeset .ms-stats > ul > li {
  margin: 0;
  padding: 0.7rem 0.3rem;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: var(--ms-radius-sm);
  text-align: center;
  font-size: 0.62rem;
  line-height: 1.35;
  color: var(--md-default-fg-color--light);
}

.md-typeset .ms-stats > ul > li > strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"] .md-typeset .ms-stats > ul > li > strong {
  color: var(--md-accent-fg-color);
}

/* --- Section headings ---------------------------------------------------- */

.md-typeset .ms-section-lede {
  margin-top: 0;
  margin-bottom: 1.1rem;
  color: var(--md-default-fg-color--light);
}

/* --- Tutorial list ------------------------------------------------------- */

/* One full-width row per tutorial. The icon is positioned out of the text flow
   so the title, blurb and tags stay a single readable column. */
.md-typeset .ms-tutorials > ul {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 2.2rem;
  padding: 0;
  list-style: none;
}

.md-typeset .ms-tutorials > ul > li {
  position: relative;
  margin: 0;
  padding: 1rem 1.1rem 1rem 3.2rem;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: var(--ms-radius);
  background: var(--md-default-bg-color);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.md-typeset .ms-tutorials > ul > li:focus-within,
.md-typeset .ms-tutorials > ul > li:hover {
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 0.25rem 0.9rem rgba(0, 0, 0, 0.11);
  transform: translateY(-0.1rem);
}

.md-typeset .ms-tutorials > ul > li > :first-child {
  margin-top: 0;
}

.md-typeset .ms-tutorials > ul > li > :last-child {
  margin-bottom: 0;
}

/* Tinted tile, vertically aligned with the title next to it. */
.md-typeset .ms-tutorials .ms-tut-icon {
  position: absolute;
  top: 1.05rem;
  left: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--ms-radius-sm);
  background: var(--md-code-bg-color);
  color: var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"] .md-typeset .ms-tutorials .ms-tut-icon {
  color: var(--md-accent-fg-color);
}

.md-typeset .ms-tutorials .ms-tut-icon .twemoji {
  display: flex;
}

.md-typeset .ms-tutorials .ms-tut-title {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.md-typeset .ms-tutorials .ms-tut-title a {
  color: var(--md-default-fg-color);
}

.md-typeset .ms-tutorials .ms-tut-title a:hover {
  color: var(--md-accent-fg-color);
}

/* The title link covers the whole row, so anywhere on it is clickable. */
.md-typeset .ms-tutorials .ms-tut-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--ms-radius);
}

/* The tags always end the row; Markdown wraps them in their own paragraph. */
.md-typeset .ms-tutorials > ul > li > p:last-child {
  margin-top: 0.6rem;
  margin-bottom: 0;
}

.md-typeset .ms-tutorials .ms-tut-tags {
  display: block;
  padding-top: 0.5rem;
  border-top: 0.05rem solid var(--md-default-fg-color--lightest);
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  color: var(--md-default-fg-color--light);
}

.md-typeset .ms-tutorials .ms-tut-tags code {
  padding: 0;
  background: transparent;
  font-size: 0.9em;
  color: inherit;
}

/* --- Roadmap ------------------------------------------------------------- */

.md-typeset .ms-roadmap > ul {
  position: relative;
  margin: 0 0 1.6rem;
  padding: 0 0 0 1.7rem;
  list-style: none;
}

.md-typeset .ms-roadmap > ul::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  bottom: 0.7rem;
  left: 0.55rem;
  width: 0.05rem;
  background: linear-gradient(
    to bottom,
    var(--md-default-fg-color--lighter),
    var(--md-default-fg-color--lightest) 70%,
    transparent
  );
}

.md-typeset .ms-roadmap > ul > li {
  position: relative;
  margin: 0 0 0.75rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

.md-typeset .ms-roadmap .ms-step {
  position: absolute;
  top: 0.02rem;
  left: -1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 0.05rem solid var(--md-default-fg-color--lighter);
  border-radius: 50%;
  background: var(--md-default-bg-color);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--md-default-fg-color--light);
}

.md-typeset .ms-roadmap > ul > li:hover .ms-step {
  border-color: var(--md-accent-fg-color);
  color: var(--md-accent-fg-color);
}

.md-typeset .ms-roadmap > ul > li > strong {
  color: var(--md-default-fg-color);
}

/* --- Further out --------------------------------------------------------- */

.md-typeset .ms-later > ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.4rem;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
}

.md-typeset .ms-later > ul > li {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: var(--ms-radius-sm);
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--md-default-fg-color--light);
}

.md-typeset .ms-later > ul > li > strong {
  color: var(--md-default-fg-color);
}

/* --- Author -------------------------------------------------------------- */

.md-typeset .ms-author {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.2rem;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: var(--ms-radius);
  background: var(--md-code-bg-color);
}

.md-typeset .ms-author > p:first-child {
  flex: 0 0 auto;
  margin: 0;
}

.md-typeset .ms-author__avatar {
  display: block;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
}

.md-typeset .ms-author__text > :first-child {
  margin-top: 0;
}

.md-typeset .ms-author__text > :last-child {
  margin-bottom: 0;
}

/* --- Teaching and consulting --------------------------------------------- */

.md-typeset .ms-offer > ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.6rem;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}

.md-typeset .ms-offer > ul > li {
  position: relative;
  margin: 0;
  padding: 1rem 1.1rem 1rem 3.2rem;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: var(--ms-radius);
  background: var(--md-default-bg-color);
}

.md-typeset .ms-offer > ul > li > :first-child {
  margin-top: 0;
}

.md-typeset .ms-offer > ul > li > :last-child {
  margin-bottom: 0;
}

/* Same tinted tile as the tutorial cards, aligned with the heading beside it. */
.md-typeset .ms-offer .ms-offer__icon {
  position: absolute;
  top: 1.05rem;
  left: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--ms-radius-sm);
  background: var(--md-code-bg-color);
  color: var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"] .md-typeset .ms-offer .ms-offer__icon {
  color: var(--md-accent-fg-color);
}

.md-typeset .ms-offer .ms-offer__icon .twemoji {
  display: flex;
}

.md-typeset .ms-offer__foot {
  margin-bottom: 0;
  color: var(--md-default-fg-color--light);
}

/* --- Closing call to action ---------------------------------------------- */

.md-typeset .ms-cta {
  margin: 2.4rem 0 1.6rem;
  padding: 1.6rem 1.2rem;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: var(--ms-radius);
  text-align: center;
}

.md-typeset .ms-cta > :first-child {
  margin-top: 0;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.md-typeset .ms-cta > :last-child {
  margin-bottom: 0;
}

.md-typeset .ms-cta .md-button {
  border-radius: 2rem;
  border-width: 0.05rem;
}

/* --- Site-wide ----------------------------------------------------------- */

.md-typeset h1,
.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.md-typeset h2 {
  margin-top: 1.8em;
}

.md-typeset h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.md-typeset .md-button {
  border-radius: 2rem;
  border-width: 0.05rem;
}

.md-header__topic:first-child .md-ellipsis {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* The site name in the header is a link back home (see overrides/partials). */
.md-header__topic .ms-header-home {
  color: inherit;
}

.md-header__topic .ms-header-home:hover {
  opacity: 0.8;
}

/* --- Medium screens ------------------------------------------------------ */

/* Below this the two hero columns get too narrow to read, so stack them. */
@media screen and (max-width: 59.984375em) {
  .ms-hero {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }

  .md-typeset .ms-hero .ms-hero__tagline {
    max-width: none;
  }

  .ms-term {
    max-width: 21rem;
  }
}

/* --- Small screens ------------------------------------------------------- */

@media screen and (max-width: 44.984375em) {
  .ms-hero {
    padding: 1.9rem 1.1rem;
    border-radius: 0.7rem;
  }

  .md-typeset .ms-hero h1 {
    font-size: 1.2rem;
  }

  .md-typeset .ms-hero .ms-hero__tagline {
    font-size: 0.78rem;
  }

  .md-typeset .ms-hero .md-button {
    display: block;
    margin: 0.3rem 0 0;
    text-align: center;
  }

  .ms-term {
    font-size: 0.52rem;
  }

  .md-typeset .ms-stats > ul {
    grid-template-columns: 1fr;
  }

  .md-typeset .ms-tutorials > ul > li {
    padding: 2.9rem 0.9rem 0.9rem;
  }

  .md-typeset .ms-tutorials .ms-tut-icon {
    top: 0.9rem;
    left: 0.9rem;
  }

  .md-typeset .ms-author {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* --- Screenshot ---------------------------------------------------------- */

.md-typeset .ms-shot {
  margin: 1.4rem 0;
  text-align: left;
}

.md-typeset .ms-shot img {
  display: block;
  width: 100%;
  border: 0.05rem solid var(--md-default-fg-color--lightest);
  border-radius: var(--ms-radius);
}

[data-md-color-scheme="default"] .md-typeset .ms-shot img[src$="#only-dark"],
[data-md-color-scheme="slate"] .md-typeset .ms-shot img[src$="#only-light"] {
  display: none;
}

.md-typeset .ms-shot > figcaption {
  max-width: none;
  margin: 0.7rem 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

/* --- Motion preferences -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .ms-term__caret {
    animation: none;
  }

  .md-typeset .ms-tutorials > ul > li {
    transition: none;
  }

  .md-typeset .ms-tutorials > ul > li:hover {
    transform: none;
  }
}
