/* dandori site styling, in the family of rulec's site: a hero that is real text rather than a
   picture of text, the overview diagram, and a flow shown beside what the checker says of it. */

/* Code is set in a face whose Japanese is exactly twice as wide as its Latin, so that a flow
   with Japanese names lines up. M PLUS 1 Code has Latin at 0.5em and Japanese at 1em; BIZ
   UDGothic, in the same proportions, draws what M PLUS 1 Code lacks. */
@import url("https://fonts.googleapis.com/css2?family=M+PLUS+1+Code:wght@400;700&family=BIZ+UDGothic:wght@400;700&display=swap");

/* The theme tightens its text, and code inherited it, which pulled a wide character apart
   from a narrow one. */
.md-typeset pre,
.md-typeset code,
.md-typeset kbd {
  letter-spacing: 0;
}

:root {
  --md-code-font: "M PLUS 1 Code", "BIZ UDGothic";
  --dd-ink: #0f1417;
  --dd-ink-2: #080b0d;
  --dd-mark: #0f9d86;
  --dd-mark-light: #5fd6bf;
  --dd-mark-dark: #0b7566;
}

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

.dd-hero {
  position: relative;
  margin: 0 0 2.4rem;
  padding: 2.6rem 2.4rem 2.4rem;
  border-radius: 1rem;
  background:
    radial-gradient(120% 140% at 14% 0%, #18262a 0%, var(--dd-ink) 46%, var(--dd-ink-2) 100%);
  color: #fff;
  overflow: hidden;
}

/* Steps laid out on a grid, kept as CSS so that it scales with the block. */
.dd-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(110% 100% at 50% 0%, #000 25%, transparent 78%);
  pointer-events: none;
}

.dd-hero > * { position: relative; z-index: 1; }

.dd-hero__mark {
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 0 1.1rem;
  display: block;
}

/* The wordmark is the command, set in the face the site sets code in. */
.dd-hero h1 {
  margin: 0;
  color: #fff;
  font-family: var(--md-code-font-family, SFMono-Regular, Consolas, Menlo, monospace);
  font-size: 2.9rem;
  line-height: 1.05;
  letter-spacing: -.045em;
  font-weight: 700;
}

.dd-hero__tag {
  margin: .5rem 0 0;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--dd-mark-light);
}

.dd-hero__lede {
  margin: 1.15rem 0 0;
  max-width: 44rem;
  font-size: .82rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, .82);
}

.dd-hero__lede strong { color: #fff; }

.md-typeset .dd-hero code {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
  padding: .1em .4em;
}

.dd-hero__cta {
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.dd-hero__cta .md-button {
  margin: 0;
  border-radius: 2rem;
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
  padding: .42rem 1.15rem;
  font-size: .72rem;
}

.dd-hero__cta .md-button:hover {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .45);
  color: #fff;
}

.dd-hero__cta .md-button--primary {
  background: var(--dd-mark);
  border-color: var(--dd-mark);
  color: #fff;
}

.dd-hero__cta .md-button--primary:hover {
  background: var(--dd-mark-light);
  border-color: var(--dd-mark-light);
  color: var(--dd-ink);
}

@media screen and (max-width: 44.9em) {
  .dd-hero { padding: 2rem 1.4rem 1.8rem; }
  .dd-hero h1 { font-size: 2.3rem; }
  .dd-hero__tag { font-size: 1.1rem; }
}

/* ---- the hero on a light page ------------------------------------ */
/* On the light scheme the same block is drawn in paper and ink: the grid stays, and so does
   the accent. */

[data-md-color-scheme="default"] .dd-hero {
  background:
    radial-gradient(120% 140% at 14% 0%, #fff 0%, #f6faf9 45%, #ebf3f1 100%);
  color: var(--dd-ink);
  border: 1px solid #dce9e5;
}

[data-md-color-scheme="default"] .dd-hero::after {
  background-image:
    linear-gradient(rgba(15, 20, 23, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 20, 23, .055) 1px, transparent 1px);
}

[data-md-color-scheme="default"] .dd-hero h1 { color: var(--dd-ink); }
[data-md-color-scheme="default"] .dd-hero__tag { color: var(--dd-mark-dark); }
[data-md-color-scheme="default"] .dd-hero__lede { color: rgba(15, 20, 23, .78); }
[data-md-color-scheme="default"] .dd-hero__lede strong { color: var(--dd-ink); }

[data-md-color-scheme="default"] .md-typeset .dd-hero code {
  background: rgba(15, 20, 23, .06);
  color: var(--dd-ink);
  border: 1px solid rgba(15, 20, 23, .12);
}

[data-md-color-scheme="default"] .dd-hero__cta .md-button {
  border-color: rgba(15, 20, 23, .22);
  color: var(--dd-ink);
}

[data-md-color-scheme="default"] .dd-hero__cta .md-button:hover {
  background: rgba(15, 20, 23, .06);
  border-color: rgba(15, 20, 23, .4);
  color: var(--dd-ink);
}

[data-md-color-scheme="default"] .dd-hero__cta .md-button--primary,
[data-md-color-scheme="default"] .dd-hero__cta .md-button--primary:hover {
  color: #fff;
}

[data-md-color-scheme="default"] .dd-hero__cta .md-button--primary:hover {
  background: var(--dd-mark-dark);
  border-color: var(--dd-mark-dark);
}

/* ---- the overview diagram ------------------------------------------ */
/* Below the width where its labels stop being legible, it scrolls sideways in its own box
   rather than shrink; the page itself never scrolls sideways. */
.dd-overview { overflow-x: auto; }
.md-typeset .dd-overview img { min-width: 44rem; }

/* ---- a row: a flow on the left, the point on the right ------------- */
/* Below the theme's own breakpoint the two stack, the flow first. */

.dd-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: center;
  margin: 1.8rem 0;
}
.dd-row + .dd-row { border-top: .05rem solid var(--md-default-fg-color--lightest); padding-top: 1.8rem; }
.md-typeset .dd-row h3 { margin: 0 0 .4rem; font-size: 1.05rem; line-height: 1.35; }
.md-typeset .dd-row p { margin: .4rem 0 0; }
.md-typeset .dd-row .highlight { margin: 0; }
.md-typeset .dd-row pre > code { font-size: .62rem; line-height: 1.5; }

.dd-row--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.dd-row--flip > :first-child { order: 2; }

@media screen and (max-width: 59.9375em) {
  .dd-row, .dd-row--flip { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  .dd-row--flip > :first-child { order: 0; }
}

/* ---- a diagnostic, shown as itself --------------------------------- */
/* What the checker prints is quoted verbatim, so it gets a terminal's colours rather than the
   page's. */

.md-typeset .dd-term > .highlight > pre > code,
.md-typeset pre.dd-term > code {
  background: var(--dd-ink);
  color: #dfe6e8;
}

/* ---- rhythm -------------------------------------------------------- */

.md-typeset h2 {
  margin-top: 2.6rem;
  letter-spacing: -.01em;
}

.md-typeset hr { margin: 2.6rem 0; }

/* A picture drawn for one colour scheme names it in the fragment. The theme ships only half of
   that pair, so the other half is written here. */
[data-md-color-scheme="slate"] .md-typeset img[src$="#only-light"] {
  display: none;
}

/* The mark in the hero carries its own background. */
.dd-hero__mark { border: 0; padding: 0; background: none; box-shadow: none; }
