/* Yokan site styling.
   The brand is the confection: a dark block, a cut face in chestnut.
   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 {
  --yk-block: #1b1d23;
  --yk-block-2: #12141a;
  --yk-cut: #c9603f;
  --yk-cut-light: #eda87c;
  --yk-cut-dark: #97402a;
}

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

.yk-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%, #262a33 0%, var(--yk-block) 45%, var(--yk-block-2) 100%);
  color: #fff;
  overflow: hidden;
}

/* the faint grid the banner had, kept as CSS so it scales */
.yk-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;
}

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

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

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

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

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

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

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

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

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

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

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

.yk-hero__cta .md-button--primary:hover {
  background: var(--yk-cut-light);
  border-color: var(--yk-cut-light);
  color: var(--yk-block);
}

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

/* ---- the hero on a light page ------------------------------------ */
/* The block is the brand, and a brand does not have to invert — but 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 cut
   from the pale end of the same confection: warm off-white, chestnut
   still the accent, the grid drawn in ink instead of light. */

[data-md-color-scheme="default"] .yk-hero {
  background:
    radial-gradient(120% 140% at 12% 0%, #fff 0%, #fbf7f4 45%, #f4ece6 100%);
  color: var(--yk-block);
  border: 1px solid #ecdfd6;
}

[data-md-color-scheme="default"] .yk-hero::after {
  background-image:
    linear-gradient(rgba(27, 29, 35, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 29, 35, .05) 1px, transparent 1px);
}

[data-md-color-scheme="default"] .yk-hero h1 { color: var(--yk-block); }
[data-md-color-scheme="default"] .yk-hero__tag { color: #a8492c; }

[data-md-color-scheme="default"] .yk-hero__lede { color: rgba(27, 29, 35, .78); }
[data-md-color-scheme="default"] .yk-hero__lede strong { color: var(--yk-block); }

[data-md-color-scheme="default"] .md-typeset .yk-hero__lede code,
[data-md-color-scheme="default"] .md-typeset .yk-hero code {
  background: rgba(27, 29, 35, .06);
  color: var(--yk-block);
  border: 1px solid rgba(27, 29, 35, .12);
}

[data-md-color-scheme="default"] .yk-hero__cta .md-button {
  border-color: rgba(27, 29, 35, .22);
  color: var(--yk-block);
}

[data-md-color-scheme="default"] .yk-hero__cta .md-button:hover {
  background: rgba(27, 29, 35, .06);
  border-color: rgba(27, 29, 35, .4);
  color: var(--yk-block);
}

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

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


/* ---- 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(.yk-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(.yk-hero__mark):not([width]):not([src*="architecture"]):not([src*="images/loop"]):not([src*="images/commands"]):not([src*="images/cycle"]) {
  max-height: 26rem;
  width: auto;
}

[data-md-color-scheme="slate"] .md-typeset img[src*="images/"]:not(.yk-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/commands"],
.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(--yk-cut);
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .4);
}
