@import url('/css/stylecheat.css');

@font-face {
  font-family: Graphabet;
  src: url('/font/Graphabet-Bold.woff2') format('woff2');
  font-weight: bold;
  font-display: swap;
}

slide h2 {
  font-family: Graphabet, var(--font-ui);
  letter-spacing: normal;
  text-transform: uppercase;
}

html,
body {
  height: 100%;
  margin: 0;
}

slide {
  align-items: center;
  justify-content: center;
  padding: calc(var(--unit) * 16) calc(var(--unit) * 6) calc(var(--unit) * 8);
  box-sizing: border-box;
}

slide-grid {
  --intro: calc(var(--unit) * 100);
  --gap: calc(var(--unit) * 12);
  container-type: size;
  display: flex;
  gap: var(--gap);
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 100%;
  padding: calc(var(--unit) * 18) calc(var(--unit) * 10);
  box-sizing: border-box;
}

slide-intro {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: calc(var(--unit) * 4);
  width: var(--intro);
}

slide-intro h1 {
  font-size: 56px;
}

slide-intro p {
  font-size: 22px;
}

slide-intro small {
  font-size: 16px;
  text-wrap: pretty;
}

slide-intro h1 svg {
  height: auto;
}

slide-grid stack {
  width: min(100cqw - var(--intro) - var(--gap), 100cqh * 6 / 7);
  aspect-ratio: 6 / 7;
}

@media (width <= 768px) {
  slide-grid {
    container-type: inline-size;
    flex-direction: column;
    align-items: stretch;
    padding-block: calc(var(--unit) * 16);
  }

  slide-intro {
    width: auto;
  }

  slide-grid stack {
    width: 100%;
  }
}

slide-grid :is(img, glyph-art) {
  width: 100%;
  height: 100%;
}

slide-grid glyph-art[flash] {
  animation: flash 900ms ease-out forwards;
}

card[splash] {
  rotate: 12deg;
}

stack card[splash] {
  place-self: start;
  width: max-content;
  margin: calc(100% * 0.5 / 6) 0 0 calc(100% * 4.5 / 6);
  translate: -20% -80%;
}

card[splash][toggle] {
  position: fixed;
  top: calc(var(--unit) * 18);
  right: calc(var(--unit) * 14);
  pointer-events: none;
}

badge[scroll-hint] {
  position: fixed;
  bottom: calc(var(--unit) * 6);
  left: 50%;
  translate: -50%;
  pointer-events: none;
  animation: hint linear both;
  animation-timeline: --slides-scroll;
  animation-range: 0 calc(var(--unit) * 30);
}

@keyframes flash {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes hint {
  to {
    opacity: 0;
  }
}

@media (hover: none) {
  slide-grid {
    padding-inline: 0;
  }

  stack card[splash] {
    display: none;
  }
}

slide-text,
slide-wide {
  display: flex;
  flex-direction: column;
  gap: calc(var(--unit) * 5);
}

slide-text {
  max-width: 640px;
  line-height: 1.65;
}

slide :is(h1, h2) {
  color: var(--primary-text);
}

slide-wide {
  width: min(1100px, 100%);
}

slide-text card {
  flex: 1 1 120px;
}

slide-text card glyph-art {
  width: 100%;
  height: 64px;
}

glyph-art {
  display: block;
}

glyph-art > svg {
  display: block;
  width: 100%;
  height: 100%;
}

slide:has(alphabet-sheet) {
  overflow: clip;
}

slide-wide:has(alphabet-sheet) > crow {
  position: relative;
}

alphabet-sheet svg {
  display: block;
  width: 100%;
  height: auto;
}

slide-wide card glyph-art {
  width: 100%;
  height: 90px;
}

card[glyph] {
  flex-basis: calc(var(--unit) * 16);
  aspect-ratio: 5 / 6;
}

card[glyph],
card[glyph] badge {
  min-width: 0;
}

card[glyph] badge {
  white-space: normal;
  text-align: center;
}

slide-wide glyph-art[big] {
  width: 200px;
  height: 240px;
}

slide-wide:has(codie) {
  width: max-content;
  max-width: 100%;
}

slide-wide codie {
  flex: 0 1 max-content;
  min-width: 0;
}

slide-wide card:has(glyph-art[big]) {
  flex: none;
  width: calc(var(--unit) * 78);
}

@media (width <= 768px) {
  slide-wide card:has(glyph-art[big]) {
    width: auto;
  }
}

legend-item,
step {
  font-family: var(--font-mono);
  font-size: 12px;
}

.piece {
  fill: var(--k);
  transition: fill 400ms ease-in-out, stroke 400ms ease-in-out;
}

polygon.piece:not(.seam) {
  stroke: var(--k);
}

legend-item {
  color: var(--k);
  transition: color 400ms ease-in-out;
}

card[gray] .piece {
  fill: var(--muted-foreground);
}

carousel[white] .piece {
  fill: #fff;
}

carousel[white] polygon.piece:not(.seam) {
  stroke: #fff;
}

carousel[white] legend-item {
  color: #fff;
}

color-toggle {
  position: fixed;
  top: calc(var(--unit) * 4);
  right: calc(var(--unit) * 4);
}

color-toggle [role='switch'],
color-toggle [role='switch']:checked {
  background-color: oklch(from var(--input) calc(l + 0.06) 0 h);
  box-shadow: var(--ring-inset);
}

color-toggle [role='switch']:before {
  background-image: conic-gradient(in oklch longer hue, oklch(0.8 0.15 0), oklch(0.8 0.15 360));
  filter: grayscale(1) brightness(3);
  transition: all 150ms ease-in-out, filter 400ms ease-in-out;
}

color-toggle [role='switch']:checked:before {
  filter: none;
}

card[picked] {
  outline: 1px solid var(--primary);
}
