/* Wakakusa site styling.
   The brand is the confection's green: young grass on dark
   ground. Two jobs here — a hero that is real text rather than a
   picture of text, and a frame for the screenshots so a dark app
   window sits on a light page instead of punching a hole in it. */

:root {
  --wk-ground: #171c18;
  --wk-ground-2: #0f120f;
  --wk-leaf: #5fa832;
  --wk-leaf-light: #a7de6b;
  --wk-leaf-dark: #3f7d28;
}

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

.wk-hero {
  position: relative;
  margin: 0 0 2.4rem;
  padding: 2.6rem 2.4rem 2.4rem;
  border-radius: 1rem;
  background:
    radial-gradient(120% 140% at 12% 0%, #223026 0%, var(--wk-ground) 45%, var(--wk-ground-2) 100%);
  color: #fff;
  overflow: hidden;
}

/* a faint grid, kept as CSS so it scales */
.wk-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(110% 100% at 50% 0%, #000 25%, transparent 78%);
  pointer-events: none;
}

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

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

.wk-hero h1 {
  margin: 0;
  color: #fff;
  font-size: 3.1rem;
  line-height: 1.05;
  letter-spacing: -.02em;
  font-weight: 700;
}

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

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

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

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

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

.wk-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;
}

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

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

.wk-hero__cta .md-button--primary:hover {
  background: var(--wk-leaf-light);
  border-color: var(--wk-leaf-light);
  color: var(--wk-ground);
}

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

/* ---- the hero on a light page ------------------------------------ */
/* A dark slab at the top of an otherwise white page reads as a picture
   someone forgot to redraw. On the light scheme the same block is the
   same grass in daylight: warm off-white with a green cast, the leaf
   still the accent, the grid drawn in ink instead of light. */

[data-md-color-scheme="default"] .wk-hero {
  background:
    radial-gradient(120% 140% at 12% 0%, #fff 0%, #f7fbf2 45%, #ecf4e0 100%);
  color: var(--wk-ground);
  border: 1px solid #dceac9;
}

[data-md-color-scheme="default"] .wk-hero::after {
  background-image:
    linear-gradient(rgba(23, 28, 24, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 28, 24, .05) 1px, transparent 1px);
}

[data-md-color-scheme="default"] .wk-hero h1 { color: var(--wk-ground); }
[data-md-color-scheme="default"] .wk-hero__tag { color: #35701f; }

[data-md-color-scheme="default"] .wk-hero__lede { color: rgba(23, 28, 24, .78); }
[data-md-color-scheme="default"] .wk-hero__lede strong { color: var(--wk-ground); }

[data-md-color-scheme="default"] .md-typeset .wk-hero__lede code,
[data-md-color-scheme="default"] .md-typeset .wk-hero code {
  background: rgba(23, 28, 24, .06);
  color: var(--wk-ground);
  border: 1px solid rgba(23, 28, 24, .12);
}

[data-md-color-scheme="default"] .wk-hero__cta .md-button {
  border-color: rgba(23, 28, 24, .22);
  color: var(--wk-ground);
}

[data-md-color-scheme="default"] .wk-hero__cta .md-button:hover {
  background: rgba(23, 28, 24, .06);
  border-color: rgba(23, 28, 24, .4);
  color: var(--wk-ground);
}

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

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

[data-md-color-scheme="default"] .wk-hero__cta .md-button--primary:hover {
  background: #35701f;
  border-color: #35701f;
}


/* ---- screenshots ------------------------------------------------- */
/* Every app window on this site is a dark image. On a light page a
   bare one reads as a hole, so each gets a rim and a shadow, and the
   rim is what separates it from the page in either scheme. */

.md-typeset img[src*="images/"]:not(.wk-hero__mark) {
  /* A mat around the picture, so a near-black app window never meets
     the page edge to edge. */
  padding: .5rem;
  background: var(--md-code-bg-color);
  border-radius: .7rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, .05),
    0 16px 34px -16px rgba(0, 0, 0, .28);
  max-width: 100%;
}

/* A picture the page sized itself keeps that size, and so does the
   diagram; only a plainly written app window gets capped, so a tall
   one does not fill the first screen. Both are excluded here rather
   than overridden below, because a `:not()` more raises specificity
   and an override loses to it. */
.md-typeset img[src*="images/"]:not(.wk-hero__mark):not([width]):not([src*="architecture"]):not([src*="images/loop"]):not([src*="images/cycle"]) {
  max-height: 26rem;
  width: auto;
}

[data-md-color-scheme="slate"] .md-typeset img[src*="images/"]:not(.wk-hero__mark) {
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, .75);
}

/* A paragraph holding nothing but a picture centres it. */
.md-typeset p:has(> img:only-child) { text-align: center; }

/* A diagram is a page's one wide picture: it takes the column. */
.md-typeset img[src*="architecture"],
.md-typeset img[src*="images/loop"],
.md-typeset img[src*="images/cycle"] {
  width: 100%;
  padding: .8rem;
}

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

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

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

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

.md-typeset .grid.cards > ul > li {
  border-radius: .6rem;
  transition: border-color .2s, box-shadow .2s;
}

.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--wk-leaf);
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .4);
}

/* ---- the elements table ------------------------------------------ */
/* The vocabulary page is one long reference table per element; the
   keyword column is code and wants to stay on one line. */

.md-typeset .wk-props table td:first-child,
.md-typeset .wk-props table th:first-child { white-space: nowrap; }

/* A table cell is narrow, and a broken `NoMethodError` reads as two
   words. Code in a table stays on one line; the table scrolls instead. */
.md-typeset table code { white-space: nowrap; }
