:root {
  color-scheme: light;
  --ink: #132b2f;
  --paper: #fbfcfa;
  --worktop: #e8eeec;
  --line: #b8c8c4;
  --teal: #075768;
  --hint: #455d60;
  font: 16px/1.45 "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--worktop);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, a { touch-action: manipulation; }
button {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: .57rem .85rem;
  border-radius: .45rem;
  cursor: pointer;
}
button:hover { border-color: var(--teal); }
button:focus-visible, a:focus-visible { outline: 3px solid #126581; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .65; }
.primary { background: var(--teal); color: white; border-color: var(--teal); }

.bar {
  min-height: 4rem;
  padding: .65rem clamp(.8rem, 4vw, 2.4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1.2rem;
  flex-wrap: wrap;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; }
.mark { width: 1.18rem; height: .9rem; border: 2px solid var(--teal); border-radius: .16rem; position: relative; }
.mark::after { content: ""; position: absolute; background: var(--teal); height: 2px; width: .52rem; bottom: -.32rem; left: .21rem; }
.connection { color: var(--hint); font-size: .88rem; }
.connection[data-online="true"]::before { content: ""; display: inline-block; border-radius: 50%; width: .45rem; height: .45rem; margin-right: .4rem; background: #2b6d48; }

.welcome {
  width: min(65rem, 100% - 2rem);
  min-height: min(31rem, 72vh);
  margin: 1.6rem auto;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .85fr);
  background: var(--paper);
  border: 1px solid var(--line);
}
.welcome-copy { padding: clamp(1.1rem, 5vw, 4rem); align-self: center; }
.label { color: var(--teal); font-weight: 700; }
.welcome h1 { margin: 0; max-width: 11em; font-size: clamp(1.8rem, 5vw, 3.6rem); line-height: 1.07; letter-spacing: -.045em; }
.welcome p { max-width: 35ch; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
#hostHint:empty { display: none; }
.welcome-visual { min-height: 9rem; position: relative; overflow: hidden; background: #daebe5; }
.welcome-visual i { position: absolute; width: 68%; aspect-ratio: 16 / 9; left: 18%; top: 30%; transform: rotate(-12deg); border: 2px solid var(--teal); background: var(--paper); }
.welcome-visual i:nth-child(2) { transform: rotate(9deg) translate(4%, 27%); background: #c5e4d9; }
.welcome-visual i:nth-child(3) { height: 18%; width: 39%; top: 47%; left: 30%; background: none; border: 4px solid #a12a5f; border-radius: 50%; transform: rotate(-7deg); }

.workspace { display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); max-width: 89rem; margin: auto; }
.rail { border-right: 1px solid var(--line); padding: 1rem .8rem; display: flex; flex-direction: column; gap: .55rem; }
.rail h1 { font-size: .84rem; margin: .1rem 0 .2rem; color: var(--hint); }
.thumb { text-align: left; display: flex; align-items: center; gap: .5rem; }
.thumb span { font-size: .76rem; opacity: .8; }
.thumb[aria-pressed="true"] { background: #d4e8e4; border-color: var(--teal); }
.editor { min-width: 0; padding: .9rem clamp(.65rem, 3vw, 2rem) 0; }
.tools { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem .8rem; margin-bottom: .75rem; }
.counter { font-size: .87rem; font-weight: 700; margin-right: auto; }
.pens { display: flex; gap: .15rem; }
.pen { padding: 0; width: 2.5rem; height: 2.5rem; border-color: transparent; background: transparent; display: grid; place-items: center; }
.pen[aria-pressed="true"] { border-color: var(--teal); background: var(--paper); }
.pen::before { content: ""; width: .95rem; height: .95rem; border-radius: 50%; background: var(--pen); }
.berry { --pen: #a12a5f; }
.blue { --pen: #126581; }
.green { --pen: #2b6d48; }

.slide { position: relative; isolation: isolate; width: min(100%, 58rem); margin: auto; aspect-ratio: 16/9; background: var(--paper); border: 1px solid #9cb6ad; overflow: hidden; container-type: inline-size; }
.slide[data-slide="1"] { background: #e3eee7; }
.slide-copy { padding: 5.5cqw 7cqw; }
.slide-heading { display: flex; align-items: center; gap: 2cqw; color: var(--teal); font-size: 2.4cqw; font-weight: 700; }
.slide-heading span { font-variant-numeric: tabular-nums; border-right: 1px solid var(--line); padding-right: 2cqw; }
.slide-heading p { margin: 0; }
.slide h2 { font-weight: 700; margin: 2cqw 0; font-size: 7.5cqw; line-height: 1.03; letter-spacing: -.045em; }
.slide ol { font-size: 3.15cqw; line-height: 1.35; padding-left: 4.7cqw; margin: 2.5cqw 0 0; }
.slide li + li { margin-top: 1.25cqw; }
#ink { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.caption { color: var(--hint); font-size: .84rem; margin: .7rem auto; width: min(100%, 58rem); overflow-wrap: anywhere; }
a { color: var(--teal); }

@media (min-width: 671px) {
  .slide, .caption { width: min(100%, 58rem, max(24rem, calc((100svh - 10rem) * 16 / 9))); }
}

@media (max-width: 670px) {
  .workspace { grid-template-columns: 1fr; }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .thumb { font-size: .82rem; padding: .48rem .55rem; }
  .welcome { grid-template-columns: 1fr; min-height: auto; }
  .welcome-visual { display: none; }
}
