body.has-studio-welcome { overflow: hidden; }

.tm-studio-welcome {
  --demo-gold: #c9a96e;
  --demo-ivory: #f5f5f1;
  --demo-muted: #c9c1b2;
  --demo-rule: rgb(245 245 241 / .16);
  --demo-ease: cubic-bezier(.22, .72, .26, 1);
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: max(.65rem, env(safe-area-inset-top)) .65rem max(.65rem, env(safe-area-inset-bottom));
  border: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: transparent;
  color: var(--demo-ivory);
  color-scheme: dark;
}

.tm-studio-welcome[open] { display: grid; place-items: safe center; }

.tm-studio-welcome::backdrop {
  background: rgb(5 5 5 / .79);
  backdrop-filter: blur(12px);
}

.tm-studio-welcome__sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(19rem, auto) auto;
  grid-template-areas: "head head" "image body" "image actions";
  width: min(73rem, 100%);
  overflow: hidden;
  border: 1px solid var(--demo-rule);
  border-radius: clamp(1rem, 2.5vw, 1.7rem);
  background: radial-gradient(ellipse at top right, #2b251e, #151310 52%, #0c0b0a);
  box-shadow: 0 2rem 6rem rgb(0 0 0 / .57);
}

.tm-studio-welcome__sheet:not([data-studio-changing]) {
  animation: tm-demo-enter .42s var(--demo-ease) both;
}

.tm-studio-welcome__header {
  display: flex;
  grid-area: head;
  align-items: center;
  justify-content: space-between;
  padding: .42rem clamp(.8rem, 2.7vw, 1.65rem);
  border-bottom: 1px solid var(--demo-rule);
}

.tm-studio-welcome__brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font: 650 .7rem/1.1 var(--sans);
  letter-spacing: .22em;
}

.tm-studio-welcome__emblem { width: 1.9rem; height: 1.9rem; flex: none; }

.tm-studio-welcome__image {
  position: relative;
  display: grid;
  grid-area: image;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  min-height: 32.25rem;
  padding: 4.5rem clamp(1.25rem, 5vw, 4.8rem) 2.7rem;
  border-inline-end: 1px solid var(--demo-rule);
  background: #1c1916;
  font: 520 .77rem/1.35 var(--sans);
}

.tm-demo-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(155deg, rgb(12 10 8 / .26), rgb(10 8 6 / .66)), var(--demo-photo);
  background-position: center, var(--demo-crop, center);
  background-size: cover;
  pointer-events: none;
}

.tm-demo-media[data-demo-scene="atlas"] {
  --demo-photo: url("../../assets/acquisition/atelier-night-decision.jpg");
  --demo-crop: 60% 56%;
}

.tm-demo-media[data-demo-scene="carnets"] {
  --demo-photo: url("../../assets/acquisition/outils-table-de-dessin.jpg");
  --demo-crop: 64% 48%;
}

.tm-demo-media[data-demo-scene="journalier"] {
  --demo-photo: url("../../assets/acquisition/journalier-command-table.jpg");
  --demo-crop: 50% 40%;
}

.tm-demo-media:not(.tm-demo-media--outgoing) { animation: tm-demo-camera .85s var(--demo-ease) both; }
.tm-demo-media--outgoing { animation: tm-demo-dissolve .5s var(--demo-ease) both; }

.tm-demo-stage-label {
  position: absolute;
  inset: .95rem 1rem auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .45rem;
  padding: .56rem .75rem;
  border: 1px solid var(--demo-rule);
  border-radius: .65rem;
  background: rgb(15 13 10 / .77);
  backdrop-filter: blur(12px);
}

.tm-demo-stage-label strong { font-weight: 640; }
.tm-demo-stage-label span { color: var(--demo-muted); font-size: .68rem; }

.tm-demo-atlas,
.tm-demo-notebook,
.tm-demo-planner { width: min(100%, 25.5rem); min-width: 0; }

.tm-demo-atlas {
  display: grid;
  padding: .46rem;
  border: 1px solid rgb(245 245 241 / .2);
  border-radius: 1.08rem;
  background: #242019;
  box-shadow: 0 1.2rem 3rem rgb(0 0 0 / .46);
}

.tm-demo-atlas__sheet,
.tm-demo-reference__drawing {
  --demo-grid: rgb(108 89 57 / .13);
  background:
    linear-gradient(90deg, var(--demo-grid) 1px, transparent 1px) center / 1.2rem 1.2rem,
    linear-gradient(var(--demo-grid) 1px, transparent 1px) center / 1.2rem 1.2rem,
    #ede7da;
  color: #322a20;
}

.tm-demo-atlas__sheet {
  display: grid;
  justify-items: center;
  gap: clamp(.72rem, 2vw, 1.6rem);
  padding: 1rem 1.3rem;
  border-radius: .7rem;
  transform-origin: top left;
}

.tm-demo-atlas__heading { display: grid; width: 100%; gap: .08rem; }
.tm-demo-atlas__heading span { font-size: .64rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.tm-demo-atlas__heading strong { font: 610 clamp(1.65rem, 3vw, 2.6rem)/.96 var(--serif); }

.tm-demo-elevation {
  position: relative;
  display: grid;
  grid-template-rows: 25% 43% 32%;
  width: 85%;
  max-height: 100%;
  aspect-ratio: 2.75;
  color: #544b3a;
  border-bottom: 1px solid currentColor;
}

.tm-demo-atlas .tm-demo-elevation::after {
  position: absolute;
  inset: 0 -6% -10%;
  border: 1px dashed rgb(104 79 38 / .45);
  pointer-events: none;
  content: "";
}

.tm-demo-elevation__roof {
  align-self: end;
  width: 38%;
  height: 100%;
  margin-left: 47%;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-radius: 1.2rem 1.2rem 0 0;
  background: #e2d9c6;
}

.tm-demo-elevation__wall {
  display: grid;
  align-content: center;
  padding-inline: 6%;
  border: 1px solid currentColor;
  background: #fbf6eb;
  box-shadow: inset 0 -.19rem 0 rgb(58 50 33 / .1);
}

.tm-demo-elevation__wall i {
  display: block;
  height: .66em;
  border: 1px solid currentColor;
  background: repeating-linear-gradient(90deg, #614d31 0 1px, #c6b898 1px 13px);
}

.tm-demo-atlas .tm-demo-elevation__wall i { animation: tm-demo-draw .6s .1s var(--demo-ease) both; }

.tm-demo-elevation__posts {
  display: flex;
  justify-content: space-around;
}

.tm-demo-elevation__posts i {
  width: 2.5%;
  border-inline: 1px solid currentColor;
  background: #d5c9af;
  transform-origin: top;
}

.tm-demo-atlas .tm-demo-elevation__posts i { animation: tm-demo-post .44s .34s var(--demo-ease) both; }
.tm-demo-atlas .tm-demo-elevation__posts i:nth-child(2) { animation-delay: .39s; }
.tm-demo-atlas .tm-demo-elevation__posts i:nth-child(3) { animation-delay: .44s; }
.tm-demo-atlas .tm-demo-elevation__posts i:nth-child(4) { animation-delay: .49s; }

.tm-demo-atlas__key { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem .8rem; width: 100%; font-size: .69rem; }
.tm-demo-atlas__key span::before { display: inline-block; width: .86em; margin-inline-end: .35em; border-top: 1px solid #8a632b; vertical-align: middle; content: ""; }
.tm-demo-atlas__key span { animation: tm-demo-enter .32s .55s var(--demo-ease) both; }

.tm-demo-atlas__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .55rem .28rem .1rem .5rem;
  color: var(--demo-muted);
}

.tm-demo-save {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  padding: .35rem .53rem;
  border-radius: 999px;
  background: var(--demo-gold);
  color: #1c1510;
  font-weight: 700;
  animation: tm-demo-tap .52s .54s var(--demo-ease) both;
}

.tm-demo-save span { font-size: 1.12em; line-height: 1; }

.tm-demo-notebook,
.tm-demo-planner {
  display: grid;
  gap: .54rem;
  padding: .7rem;
  border: 1px solid rgb(245 245 241 / .26);
  border-radius: 1rem;
  background: rgb(22 18 14 / .94);
  box-shadow: 0 1.2rem 3rem rgb(0 0 0 / .44);
}

.tm-demo-notebook__shelf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .35rem .45rem .26rem;
  color: var(--demo-ivory);
  font-weight: 650;
}

.tm-demo-notebook__shelf span { color: var(--demo-gold); animation: tm-demo-enter .36s .22s var(--demo-ease) both; }

.tm-demo-reference {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .62rem;
  min-width: 0;
  padding: .39rem;
  border: 1px solid var(--demo-rule);
  border-radius: .62rem;
  background: #34302a;
  color: var(--demo-ivory);
  transform-origin: top left;
}

.tm-demo-reference__drawing {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 2.3rem;
  flex: none;
  border-radius: .32rem;
}

.tm-demo-reference__drawing .tm-demo-elevation { width: 74%; }
.tm-demo-reference__drawing .tm-demo-elevation__wall i { height: .19em; }
.tm-demo-reference__drawing .tm-demo-elevation__roof { border-radius: .35em .35em 0 0; }

.tm-demo-reference > div:last-child,
.tm-demo-planner__task > div { display: grid; gap: .1rem; }

.tm-demo-reference span,
.tm-demo-planner__task span:not(.tm-demo-planner__check) { color: var(--demo-muted); font-size: .68rem; }

.tm-demo-notebook__note {
  margin-inline: .24rem;
  padding: .67rem .67rem .78rem;
  border-radius: .18rem .2rem .62rem .62rem;
  border-inline-start: 2px solid var(--demo-gold);
  background: #f3eee1;
  color: #382d20;
  animation: tm-demo-note .43s .2s var(--demo-ease) both;
}

.tm-demo-notebook__note span {
  color: #725318;
  font-size: .62rem;
  font-weight: 740;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.tm-demo-notebook__note p {
  margin: .18rem 0 0;
  color: inherit;
  font: italic 610 1.2rem/1.12 var(--serif);
}

.tm-demo-planner__week {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .19rem;
  padding: .29rem;
  border-radius: .58rem;
  background: #f3eee1;
  color: #5a4a38;
  text-align: center;
}

.tm-demo-planner__week span { display: grid; padding: .25rem 0; border-radius: .33rem; }
.tm-demo-planner__week strong { color: #2f261c; }
.tm-demo-planner__week .is-selected {
  color: #21180e;
  background: var(--demo-gold);
  animation: tm-demo-date .39s .13s var(--demo-ease) both;
}

.tm-demo-planner__task {
  display: flex;
  align-items: center;
  gap: .52rem;
  padding: .6rem .48rem;
  border: 1px solid var(--demo-rule);
  border-radius: .57rem;
  background: #2d271e;
  animation: tm-demo-enter .42s .29s var(--demo-ease) both;
}

.tm-demo-planner__check {
  width: .78rem;
  height: .78rem;
  flex: none;
  border: 1px solid var(--demo-gold);
  border-radius: .18rem;
}

.tm-studio-welcome__body {
  display: grid;
  grid-area: body;
  align-content: end;
  justify-items: start;
  gap: 1rem;
  min-width: 0;
  padding: clamp(1rem, 3.2vw, 2.7rem) clamp(1rem, 3.8vw, 3.6rem) 0;
}

.tm-studio-welcome__chapters {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .56rem;
}

.tm-studio-welcome__body h2 {
  margin: 0;
  color: inherit;
  font: 520 clamp(2.55rem, 4.8vw, 4.8rem)/.93 var(--serif);
  letter-spacing: -.025em;
  text-wrap: balance;
}

.tm-studio-welcome__body h2:focus { outline: none; }

#tm-studio-welcome-description {
  max-width: 38ch;
  margin: 0;
  color: var(--demo-muted);
  font: 450 .96rem/1.55 var(--sans);
}

[data-studio-changing] :is(#tm-studio-welcome-title, #tm-studio-welcome-description) {
  animation: tm-demo-enter .34s var(--demo-ease) both;
}

.tm-studio-welcome__actions {
  display: flex;
  grid-area: actions;
  align-content: start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .44rem;
  padding: 1.2rem clamp(1rem, 3.8vw, 3.6rem) clamp(1.1rem, 4.8vw, 3.85rem);
}

.tm-studio-welcome button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  min-height: 44px;
  max-width: 100%;
  padding: .5rem .86rem;
  border: 1px solid var(--demo-rule);
  border-radius: 999px;
  background: transparent;
  color: var(--demo-ivory);
  cursor: pointer;
  font: 620 .83rem/1.15 var(--sans);
  text-align: center;
  text-wrap: balance;
  transition: background-color .18s, border-color .18s;
}

.tm-studio-welcome button:hover { background: rgb(245 245 241 / .09); }
.tm-studio-welcome button:focus-visible { outline: 2px solid var(--demo-gold); outline-offset: 2px; }
.tm-studio-welcome button.is-primary { border-color: var(--demo-gold); background: var(--demo-gold); color: #18140e; }
.tm-studio-welcome button.is-primary:hover { background: #dfc18b; }
.tm-studio-welcome button.tm-studio-welcome__dismiss { color: var(--demo-muted); }

.tm-studio-welcome .tm-studio-welcome__chapters button {
  padding-inline: .46rem;
  border: 1px solid transparent;
  border-bottom-color: var(--demo-rule);
  border-radius: .28rem .28rem 0 0;
  color: var(--demo-muted);
}

.tm-studio-welcome__chapters button[aria-current="step"] {
  border-bottom-color: var(--demo-gold);
  color: var(--demo-gold);
}

@keyframes tm-demo-enter {
  from { opacity: 0; transform: translateY(.64rem); }
  to { opacity: 1; transform: none; }
}

@keyframes tm-demo-camera { from { transform: scale(1.045); } to { transform: none; } }
@keyframes tm-demo-dissolve { to { opacity: 0; } }
@keyframes tm-demo-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes tm-demo-post { from { transform: scaleY(.1); } to { transform: scaleY(1); } }

@keyframes tm-demo-tap {
  50% { transform: scale(.95); box-shadow: 0 0 0 .28rem rgb(201 169 110 / .26); }
}

@keyframes tm-demo-note {
  from { opacity: 0; transform: translateY(-1rem); }
  to { opacity: 1; transform: none; }
}

@keyframes tm-demo-date {
  from { background: transparent; }
  to { background: var(--demo-gold); }
}

@media (max-width: 720px) {
  .tm-studio-welcome__sheet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "head" "image" "body" "actions";
  }
  .tm-studio-welcome__image {
    min-height: 0;
    padding: 2.65rem .9rem .62rem;
    border-inline-end: 0;
    border-bottom: 1px solid var(--demo-rule);
  }
  .tm-demo-stage-label { inset: .45rem .65rem auto; padding: .3rem .51rem; }
  .tm-demo-atlas { width: min(100%, 21rem); padding: .28rem; }
  .tm-demo-atlas__sheet { gap: .38rem; padding: .51rem .67rem; }
  .tm-demo-atlas__heading span { font-size: .55rem; }
  .tm-demo-atlas__heading strong { font-size: 1.35rem; }
  .tm-demo-atlas .tm-demo-elevation { width: min(60%, 10.2rem); }
  .tm-demo-atlas__key { font-size: .61rem; }
  .tm-demo-atlas__caption { padding: .28rem .16rem .02rem .35rem; font-size: .67rem; }
  .tm-demo-save { padding: .23rem .42rem; }
  .tm-demo-notebook,
  .tm-demo-planner { width: min(100%, 21rem); gap: .32rem; padding: .43rem; }
  .tm-demo-notebook__shelf { padding: .22rem .3rem .13rem; }
  .tm-demo-notebook__note { padding: .34rem .47rem .42rem; }
  .tm-demo-notebook__note p { font-size: 1.02rem; }
  .tm-demo-reference { padding: .25rem; }
  .tm-demo-reference__drawing { width: 3.15rem; height: 1.7rem; }
  .tm-demo-planner__week { padding: .17rem; }
  .tm-demo-planner__week span { padding: .17rem 0; }
  .tm-demo-planner__task { padding: .28rem .35rem; }
  .tm-studio-welcome__body { align-content: start; gap: .44rem; padding-top: .4rem; }
  .tm-studio-welcome__body h2 { font-size: clamp(1.95rem, 8vw, 3.15rem); }
  .tm-studio-welcome__actions { padding-top: .64rem; padding-bottom: .75rem; }
  .tm-studio-welcome__actions button { flex: 1 1 auto; }
  .tm-studio-welcome__chapters { gap: .16rem .38rem; }
  #tm-studio-welcome-description { font-size: .9rem; line-height: 1.42; }
}

@media (max-width: 380px) and (max-height: 640px) {
  .tm-studio-welcome__image { padding-block: 2.35rem .43rem; }
  .tm-demo-stage-label { inset-block-start: .33rem; }
  .tm-demo-atlas__sheet { gap: .28rem; padding-block: .42rem; }
  .tm-demo-atlas .tm-demo-elevation { width: min(53%, 9rem); }
  .tm-studio-welcome__body h2 { font-size: 1.85rem; }
  .tm-studio-welcome__actions { gap: .32rem; padding-block: .52rem .58rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tm-studio-welcome .tm-studio-welcome__sheet,
  .tm-studio-welcome .tm-studio-welcome__sheet * {
    animation: none !important;
    transition: none !important;
  }
  .tm-studio-welcome .tm-demo-media--outgoing { display: none; }
}
