/* one look only: no dark mode, and no browser auto-darkening */
:root { color-scheme: only light; }

body {
  display: flex;
  justify-content: center;
  padding-top: 50px;
}

b {
  --stroke-color: black;
  --stroke-width: 0.3px;
  text-shadow: var(--stroke-width)  0 0 var(--stroke-color),
    calc(var(--stroke-width) * -1) 0 0 var(--stroke-color),
    0 var(--stroke-width) 0 var(--stroke-color),
    0 calc(var(--stroke-width) * -1) 0 var(--stroke-color);
}

canvas {
  animation: fadein 0.4s;
  animation-timing-function: ease-in;
}

#sandbox {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 600px;
  position: relative;
  flex: 0 0 1000px;
  /* border-style: solid; */
}

@media (max-width: 480px) {
  /* The slide is exactly the screen's height (100svh, the height with the
     browser bars showing), so there's nothing to scroll and the bars stay
     put. The page is otherwise left alone, so pulling down still refreshes. */
  body {
    margin: 0;
    padding-top: 0;
  }
  #sandbox {
    flex: 0 0 100vw;
    height: 100svh;
    /* nothing poking past the edge can make the page scrollable */
    overflow: clip;
  }
  /* side to side drags (the spectrum, sliders) go to the slide, while up and
     down is left to the browser for pull to refresh. The mixers' drawing
     canvases set touch-action: none themselves, so drawing never pans. */
  canvas, wired-slider {
    touch-action: pan-y;
  }
  .next-button {
    left: auto !important;
    right: 20px;
    top: auto !important;
    bottom: 20px;
  }
  .back-button {
    left: 20px !important;
    top: auto !important;
    bottom: 20px;
  }
  .textbox {
    text-align: center;
  }
}

.object {
	position: absolute;
  opacity: 0;
  animation: fadein 0.4s;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
  transition: left 1s ease-out 0s;
}

@keyframes fadein {
  from {
      opacity:0;
  }
  to {
      opacity:1;
  }
}

.delay3 {
  animation-delay: 3s;
}
.delay4p5 {
  animation-delay: 4.5s;
}
.delay6 {
  animation-delay: 6s;
}

.textbox{
  font-family: Gaegu;
}

/* sliders show the pointing hand like the buttons do (wired-slider doesn't
   set one itself) */
wired-slider {
  cursor: pointer;
}

wired-button:hover {
  transform: scale(1.05) perspective(1px);
}

.next-button {
  left: 700px;
  top: 500px;
  font-size: 30px;
}

.back-button {
  left: 200px;
  top: 500px;
  font-size: 30px;
}

/* short hand drawn rays in a flat oval all the way around a word,
   e.g. <span class="rays">light</span>. The margin gives the word a little room
   from the lines above and below and from its neighbors, and the rays sit in that
   room, behind the text, so they don't cross other words. */
.rays {
  position: relative;
  display: inline-block;
  margin: 0.2em 0.15em;
}

.rays::before {
  content: '';
  position: absolute;
  left: -0.4em;
  right: -0.4em;
  top: -0.25em;
  bottom: -0.25em;
  z-index: -1;
  pointer-events: none;
  background: center / 100% 100% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 235 175' preserveAspectRatio='none'%3E%3Cpath d='M205 111Q216 115 228 116M189 145Q197 154 207 158M162 153Q166 162 174 169M128 154Q132 163 132 173M105 154Q103 163 101 172M75 153Q72 161 65 168M43 144Q33 149 25 157M29 113Q18 118 6 118M29 73Q18 74 8 69M44 39Q35 35 28 28M80 30Q74 22 70 13M108 30Q107 21 105 12M127 30Q130 20 131 10M162 31Q167 22 174 14M192 40Q199 33 208 29M205 71Q216 69 226 65' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}

/* "by Jason" on the title slide, a link back to the portfolio page */
.byline {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.byline:hover,
.byline:focus-visible {
  color: #f0a500;
}

/* "draw here!" with a pencil above it on the color mixers, near the bottom
   of the canvas, removed once someone starts painting */
.draw-hint {
  left: 50%;
  bottom: 8px;
  width: 100px;
  margin-left: -50px;
  pointer-events: none;
  text-align: center;
}

.draw-hint svg {
  display: block;
  margin: 0 auto 2px;
}

.draw-hint-text {
  font-family: Gaegu, cursive;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
}

/* the "Not red, yellow, blue?" caption under the arrows diagram on the
   paint slide, and the note it opens. The note floats over what's below, so opening it moves nothing. */
.note-anchor {
  position: relative;
}

.note-link {
  /* small, muted and dotted-underlined so it reads as something to tap,
     with line-height 1 so it never makes its line taller */
  margin: 0 0 0 4px;
  padding: 0;
  border: none;
  background: none;
  color: #888;
  font-family: Gaegu, cursive;
  font-size: 0.65em;
  line-height: 1;
  vertical-align: baseline;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}

/* the caption sits centered under the diagram (on phones the diagram is
   centered, so the caption is centered on the screen too) */
.diagram-caption {
  display: block;
  box-sizing: border-box;
  text-align: center;
  margin-top: -4px;
  line-height: 1;
}

.diagram-caption .note-link {
  margin: 0;
  font-size: 15px;
}

/* a term inside a sentence that opens a note: it keeps the sentence's own
   font, size, weight and color, and only gains the dotted underline */
.note-link.inline-term {
  margin: 0;
  font: inherit;
  color: inherit;
  line-height: inherit;
  white-space: normal;
}

.note-link.inline-term:hover,
.note-link.inline-term[aria-expanded='true'] {
  color: #555;
}

.note-link:hover,
.note-link[aria-expanded='true'] {
  color: #444;
}

.note-popup {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 10;
  width: 340px;
  box-sizing: border-box;
  white-space: normal;
  padding: 8px 12px;
  background: #fff;
  border: 2px solid #444;
  border-radius: 8px;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.15);
  font-family: Gaegu, cursive;
  font-size: 18px;
  font-weight: normal;
  /* a note inside bold text would otherwise inherit the bold outline */
  text-shadow: none;
  line-height: 1.25;
  text-align: left;
  color: #222;
}

.note-popup[hidden] {
  display: none;
}

@keyframes fadeout {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* hidden while the font and widgets load (see index.html's head), then faded in */
#sandbox { transition: opacity 0.3s ease-in; }
html.loading #sandbox { opacity: 0; }
@media (prefers-reduced-motion: reduce) { #sandbox { transition: none; } }
